220 likes | 334 Views
IP. Orientation. IP (Internet Protocol) is a Network Layer Protocol. IP’s current version is Version 4 (IPv4). It is specified in RFC 891. Class A:. 0. Network (7 bits). Host (24 bits). 1. 0. Class B:. Network (14 bits). Host (16 bits). 1. 1. 0. Class C:. Network (21 bits).
E N D
Orientation • IP (Internet Protocol) is a Network Layer Protocol. • IP’s current version is Version 4 (IPv4). It is specified in RFC 891.
Class A: 0 Network (7 bits) Host (24 bits) 1 0 Class B: Network (14 bits) Host (16 bits) 1 1 0 Class C: Network (21 bits) Host (8 bits) IPv4 Address Model
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.
Application protocol IP is the highest layer protocol which is implemented at both routers and hosts
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
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) unicast broadcast 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
IP Datagram Format • 20 bytes ≤Header Size< 24 x 4 bytes = 60 bytes • 20 bytes ≤Total Length< 216 bytes = 65536 bytes
IP Datagram Format • Transmission is row by row • For each row: 1. First transmit bits 0-7 2. Then transmit bits 8-15 3. Then transmit bits 16-23 4. 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 iscallednetwork 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
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: 4352 802.3: 1492 ATM AAL5: 9180 802.5: 4464 PPP: negotiated
Datagram Lifetime • Datagrams could loop indefinitely • Consumes resources • Transport protocol may need upper bound on datagram life • Datagram 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
IP Fragmentation • What if the route contains networks with different MTUs? Or exceeds? • MTUs:FDDI: 4352Ethernet: 1500 • Fragmentation: • IP router splits the datagram into several datagram • Fragments are reassembled at receiver
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
length =1500 length =4000 length =1040 length =1500 ID =x ID =x ID =x ID =x moreflag =0 moreflag =1 moreflag =0 moreflag =1 offset =0 offset =0 offset =1480 offset =2960 IP Fragmentation and Reassembly One large datagram becomes several 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 failure • Re-assembly time out • Assigned to first fragment to arrive • If timeout expires before all fragments arrive, discard partial data
Error Control • Not guaranteed delivery • Router should attempt to inform source if packet discarded • e.g. for time to live expiring • Source may modify transmission strategy • May inform high layer protocol • Datagram identification needed • Destination doesn’t ACK or NAK if checksum fails, no retries, best-effort like Ethernet