Transcript ICOM 6115

ICOM 6115 – Computer Networks
and the WWW
Manuel Rodriguez-Martinez, Ph.D.
Lecture 21
ICOM 6115
©Manuel Rodriguez-Martinez
Lecture Objectives
• Introduction to Global Internetworking
– Layer 3 – The Network Layer
• Store-and-Forward Service
– IP Protocol
• IP addressing
• ARP, ICMP
– Routing
ICOM 6115
©Manuel Rodriguez-Martinez
Internetworking
• What is this?
– Process of connecting independent and possibly
heterogeneous LANs into a larger network
• Again: Independent LANs
– Each LAN might have a different Layer 2
• Ethernet
• Token Ring
• 802.11b
• What Layer takes care of this service?
– Network Layer (Layer 3)
ICOM 6115
©Manuel Rodriguez-Martinez
Example internetwork
H1
H2 Network 1 (Ethernet)
H7
R4
Network 5
(Point-to-Point)
Network 4 (Ethernet)
R1
Network 3
(FDDI)
R3
H3
H4
H6
H5
ICOM 6115
R2
Network 2
(802.11b)
©Manuel Rodriguez-Martinez
H8
Layer 3 and LAN Integration
Multiple, heterogeneous LANs can become
Interoperable via IP (Layer 3 example)
ICOM 6115
©Manuel Rodriguez-Martinez
Layer 3: Packet Switching
• Layer 3 deals with getting packets
forwarded from source to destination
– Across LANs
• Layer 2 was switching within a LAN
• Routers are computers that provide
service of packet forwarding
– Must understand the topology of internet
– Forwarding must be fast
– Routing should produce accurate forwarding
tables
ICOM 6115
©Manuel Rodriguez-Martinez
Store-and-Forward Service
• Packets are send by end-host to routers
• Routers
– Store each packet until fully arrives
– Make checksum calculations
– Lookup forwarding tables to determine next
hop
• A router or final destination host
– Forward the packet along the line (port) of
next hop
ICOM 6115
©Manuel Rodriguez-Martinez
Store-and-Forward Packet Switching
Routers form a subnet of forwarding elements
ICOM 6115
©Manuel Rodriguez-Martinez
Layer 3 Service Principles
• Layer 3 will provide Layer 4 (Transport
Layer) packet forwarding services
– Connectionless
– Connection-oriented
• Driving Principles
– Should independent of router technology
– Transparency from routers for Layer 4
• Type, number and topology
– Uniform addressing scheme across network
• LANs and WANs
ICOM 6115
©Manuel Rodriguez-Martinez
Connectionless Service
• Advocated by Internet community
– IP Protocol
• Data is broken into packets, that are
moved independently over the network
– Datagram
– Each one can take a different path
• Most often they all take the same path
• Each router moves the datagram along
path from src to dst
ICOM 6115
©Manuel Rodriguez-Martinez
Route Information
Routers typically store routes to networks
as the router next router to get there
ICOM 6115
©Manuel Rodriguez-Martinez
Example Forwarding Tables
A’s Forwarding
Table
C’s Forwarding
Table
E’s Forwarding
Table
A
-
A
A
A
C
B
B
B
A
B
D
C
C
C
-
C
C
D
B
D
D
D
D
E
B
E
E
E
-
F
C
F
E
F
F
ICOM 6115
©Manuel Rodriguez-Martinez
Connection-Oriented Service
• Advocated by Telephone companies
– ATM Protocol
• Data is broken into packets, that are
moved along a virtual circuit (VC) over the
network
– Circuit must be first set up
– Each packet takes the same path
• Driven by performance guarantees
– Bounds on delays for packet arrival
ICOM 6115
©Manuel Rodriguez-Martinez
Virtual Circuit based network
ICOM 6115
©Manuel Rodriguez-Martinez
IP: Network Layer on Internet
ICOM 6115
©Manuel Rodriguez-Martinez
IP features
• Connectionless
• Best effort delivery
– Every effort is made to deliver datagram
• No guarantee is made
– Can be lost or delivered out of order
– Simplicity
– Unreliable
• Need transport to add reliability (TCP)
• Runs over “anything”
– Support many Layer 2 protocols
• Many invented after IP (e.g. 802.11b)
ICOM 6115
©Manuel Rodriguez-Martinez
ICOM 6115
65KB Max Length
Variable length
IP v4 Packet Format
©Manuel Rodriguez-Martinez
Some Issues
• Header length is measured in terms of 32bit word
• Datagram length is measured in terms of
number of bytes
– Max size is 64KB
• Fragments indicates offset in terms of 8byte chunks
– Only have 13 bits to expresses offset
ICOM 6115
©Manuel Rodriguez-Martinez
Fragmentation and Reassembly
• Packets might get fragmented as they
travel over the net
• Why?
– Layer 2 might have different max frame size
• Example:
– 10Mbps Ethernet – max frame size is 1500 bytes
– 100Mbps FDDI – max frame size is 4500 bytes
– 56Kbps PPP – max frame size is 532 bytes
– Packet might get cut to make it fit into Layer 2
frame
ICOM 6115
©Manuel Rodriguez-Martinez
Example of Fragmentation
Packet gets broken along the way to make it fit
Layer 2 frame. It must be reassembled by end-receiver
ICOM 6115
©Manuel Rodriguez-Martinez
Network MTU
• Each network has a maximum
transmission unit (MTU)
– Biggest IP datagram that be fit into a frame
• IP datagram can have variable size
• Good idea is to keep it under MTU
– Avoid fragmentation whenever possible
• Let it happen on a case by case basis (be flexible)
– Send as much data as possible in each frame
• Good use of bandwidth
ICOM 6115
©Manuel Rodriguez-Martinez
Reassembly
• Routers can fragment packet
– They won’t reassemble it
– Each fragment gets forwarded independently
• End-receiver deals with the problem of
reassembling the packet
– Putting pieces back in order
– Lost fragment causes retransmission of entire
packet!
ICOM 6115
©Manuel Rodriguez-Martinez
Control Information for reassembly
• Each packet carries an identification number
– Sequence number
• Fragments are identified as parts of packet with
given id number
– Fragment identifies offset bytes for a packet
– Example: offset for individual bytes
• Offset 0 of packet 10287
• Offset 512 of packet 10287
• Offset 1024 of packet 10287
– In reality, offset counts groups of 8-bytes
ICOM 6115
©Manuel Rodriguez-Martinez
IP Addresses
• Unique, Global identifier for a network card
– Machines with multiple card get multiple IPs
• e.g. routers
• IP address is a 32 bit number
– For simplicity, expressed in dotted-decimal
notation
• e.g. 128.34.5.92
Bits
32
128
ICOM 6115
34
0
5
©Manuel Rodriguez-Martinez
92
What are benefits of IP Addresses?
• Hierarchical structure
– Provide way to identify network and host
• Ethernet are flat
– Example: 135.134.9.20
• Host 20
• Network 135.134.9.0
• Routers need only to keep information
about network
– subnets
ICOM 6115
©Manuel Rodriguez-Martinez
IP Address Formats
ICOM 6115
©Manuel Rodriguez-Martinez
Fragmentation in packets
Start of header
Start of header
Id = X
0 Offset=0
Fragmentation
1 Offset=0
Id = X
Rest of Header
Rest of Header
1400 data bytes
512 data bytes
Fragment 1
Start of header
Id = X
1
512
Offset
Start of header
Id = X
0
1024
Rest of Header
Rest of Header
512 data bytes
512 data bytes
Fragment 2
ICOM 6115
Fragment 3
©Manuel Rodriguez-Martinez
Offset