ip. orientation 2 ip (internet protocol) is a network layer protocol. ip’s current version is...
TRANSCRIPT
IP
2
Orientation
IP (Internet Protocol) is a Network Layer Protocol.
IP’s current version is Version 4 (IPv4). It is specified in RFC 891.
NetworkLayer
Link Layer
IP
ARPNetworkAccess
Media
ICMP IGMP
TransportLayer
TCP UDP
IPv4 Address Model
Class Network ID Host ID # of Addresses
# of Networks
A 0 + 7 bit 24 bit 224-2 126
B 10 + 14 bit 16 bit 65,536 - 2 214
C 110 + 21 bit 8 bit 256 - 2 221
D 1110 + Multicast Address IP Multicast
E Future Use
0Network (7 bits)
Network (14 bits)
1 1 0
1 0
Network (21 bits)
Host (24 bits)
Host (16 bits)
Host (8 bits)
Class A:
Class B:
Class C:
4
IP: The waist of the hourglass
IP is the waist of the hourglass of the Internet protocol architecture
Multiple higher-layer protocols
Multiple lower-layer protocols
Only one protocol at the network layer.
Applications
HTTP FTP SMTP
TCP UDP
IP
Data link layer protocols
Physical layer protocols
5
Application protocol
IP is the highest layer protocol which is implemented at both routers and hosts
Application
TCP
IP
Data Link
Application
TCP
IP
NetworkAccess
Application protocol
TCP protocol
IP protocol IP protocol
DataLink
DataLink
IP
DataLink
DataLink
IP
DataLink
DataLink
DataLink
IP protocol
RouterRouter HostHost
6
IP Service
Delivery service of IP is minimal
IP provide provides an unreliable connectionless best effort service (also called: “datagram service”).
Unreliable: IP does not make an attempt to recover lost packets
Connectionless: Each packet (“datagram”) is handled independently. IP is not aware that packets between hosts may be sent in a logical sequence
Best effort: IP does not make guarantees on the service (no throughput guarantee, no delay guarantee,…)
IP
IP is connectionless in the end-to-end delivery Data delivered in datagrams (packets / frames),
each with a header Combines collection of physical networks
into single, virtual network
Transport protocols use this connectionless service to provide connectionless data delivery (UDP) and connection-oriented data delivery (TCP)
IP is Best Effort Delivery
IP provides service equivalent to LAN Does not guarantee to prevent
Duplicate datagrams Delayed or out-of-order delivery Corruption of data Datagram loss
Reliable delivery provided by transport layer Network layer - IP - can detect and report
errors without actually fixing them
IP Problems
• Higher layer protocols have to deal with losses or with duplicate packets
• Packets may be delivered out-of-sequence
10
IP Service
IP supports the following services: one-to-one (unicast) one-to-all (broadcast) one-to-several (multicast)
IP multicast also supports a many-to-many service. IP multicast requires support of other protocols (IGMP, multicast
routing)
unicastbroadcast multicast
The IP Datagram
Formally, the unit of IP data delivery is called a datagram
Includes header area and data area Datagrams can have different sizes
Header area usually fixed (20 octets) but can have options Data area can contain between 1 octet and 65,535 octets
(216- 1) Usually, data area much larger than header
Forwarding Datagrams
The header contains all the information needed to deliver a datagram to a destination computer Destination address Source address Identifier Other delivery information
Routers examine the header of each datagram and forwards the datagram along a path to the destination Use routing table to compute next hop Update routing tables using algorithms previously
discussed Link state, distance vector, manually
13
IP Datagram Format
20 bytes ≤ Header Size < 24 x 4 bytes = 60 bytes 20 bytes ≤ Total Length < 216 bytes = 65536 bytes
ECNversionheaderlength
DS total length (in bytes)
Identification Fragment offset
source IP address
destination IP address
options (0 to 40 bytes)
payload
4 bytes
time-to-live (TTL) protocol header checksum
bit # 0 15 23 248 317 16
0MF
DF
14
IP Datagram Format
Transmission is row by row For each row:
1. First transmit bits 0-72. Then transmit bits 8-153. Then transmit bits 16-234. Then transmit bits 24-31
Note: Many computers (incl. Intel processors) store 32-bit words in little endian format. Others (incl. Motorola processors) use big endian.
This is called network byte order (LE or BE)"Big Endian" means that the high-order byte of the
number is stored in memory at the lowest address, and the low-order byte at the highest address.
0x1234: BE: 12 34 LE: 34 12
15
Maximum Transmission Unit
Maximum size of IP datagram is 65535, but the data link layer protocol generally imposes a limit that is much smaller
Example: Ethernet frames have a maximum payload of 1500 bytes
IP datagrams encapsulated in Ethernet frame cannot be longer than 1500 bytes
The limit on the maximum IP datagram size, imposed by the data link protocol is called maximum transmission unit (MTU)
• MTUs for various data link protocols: Ethernet: 1500 FDDI: 4352802.3: 1492 ATM AAL5: 9180802.5: 4464 PPP: negotiated
Datagram Lifetime
Datagrams could loop indefinitely Consumes resources Transport protocol may need upper bound on
datagram lifeDatagram marked with lifetime
Time To Live field in IP Once lifetime expires, datagram discarded (not
forwarded) Hop count
Decrement time to live on passing through a each router Time count
Need to know how long since last router
17
IP Fragmentation
FDDIRing
RouterHost A Host B
Ethernet
MTUs: FDDI: 4352 Ethernet: 1500
• Fragmentation: • IP router splits the datagram into several datagram• Fragments are reassembled at receiver
• What if the route contains networks with different MTUs? Or exceeds?
18
Where is Fragmentation done?
Fragmentation can be done at the sender or at intermediate routers
The same datagram can be fragmented several times. Reassembly of original datagram is only done at
destination hosts
Router
IP datagram H Fragment 1 H1Fragment 2 H2
IP Fragmentation and Reassembly
ID=x
offset=0
moreflag=0
length=4000
ID=x
offset=0
moreflag=1
length=1500
ID=x
offset=1480
moreflag=1
length=1500
ID=x
offset=2960
moreflag=0
length=1040
One large datagram becomesseveral smaller datagrams
Fragmenting Fragments
A fragment may encounter a subsequent network with even smaller MTU Router fragments the fragment to fit Resulting (sub)fragments look just like original
fragments (except for size) No need to reassemble hierarchically; (sub)fragments
include position in original datagram
Dealing with Failure
Re-assembly may fail if some fragments get lost
Need to detect failureRe-assembly time out
Assigned to first fragment to arrive If timeout expires before all fragments arrive, discard
partial data
Error Control
Not guaranteed deliveryRouter should attempt to inform source if
packet discarded e.g. for time to live expiring
Source may modify transmission strategyMay inform high layer protocolDatagram identification needed
Destination doesn’t ACK or NAK if checksum fails, no retries, best-effort like Ethernet