1 / 12

CENG415 – Communication Networks

CENG415 – Communication Networks. Lectures 14 Network layer – IP protocol. ICMP/IP protocol error reporting router “signaling”. IP protocol addressing conventions datagram format packet handling conventions. Routing protocols path selection RIP, OSPF, BGP. forwarding table.

travis
Download Presentation

CENG415 – Communication Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CENG415 – Communication Networks Lectures 14 Network layer – IP protocol

  2. ICMP/IP protocol • error reporting • router “signaling” • IP protocol • addressing conventions • datagram format • packet handling conventions • Routing protocols • path selection • RIP, OSPF, BGP forwarding table The Internet Network Layer Host, router network layer functions: Transport layer: TCP, UDP Network layer Link layer physical layer

  3. IP protocol version number 32 bits total datagram length (bytes) head. len type of service header length (bytes) length ver for fragmentation/ reassembly fragment offset “type” of data flgs 16-bit identifier max number remaining hops (decremented at each router) upper layer time tolive header checksum 32 bit source IP address 32 bit destination IP address upper layer protocol to deliver payload to E.g. timestamp, record route taken, specify list of routers to visit. Options (if any) data (variable length, typically a TCP or UDP segment) IP Datagrapm Format

  4. Fragmentation & Reassembly Definition • MTU: Maximum Transfer size. The maximum number of a datagram in bytes, including the IP header, that can travel a specific network (LAN) • Fragmentation is the process of dividing a Datagram into smaller pieces. Why? • A datagram reaches a router and need to be transferred to a network with MTU smaller than the datagram size Where? • Fragmentation happen in Routers • Reassembly in destination host only • How? • Identifier, Flags and Fragment Offset

  5. length =1500 ID =x length =4000 ID =x ID =x length =1500 length =1040 ID =x fragflag =1 offset =0 fragflag =0 fragflag =0 offset =0 offset =370 fragflag =1 offset =185 One large datagram becomes several smaller datagrams Fragmentation & Reassembly Example • 4000 byte datagram • MTU = 1500 bytes 1480 bytes in data field offset =1480/8 Steps: 1. Subtract 20 from original length: 4000 -20 = 3980 (bytes of "IP data") 2. Subtract 20 from new MTU: 1500- 20 = 1480 (max. bytes of data in each fragment) 3. Divide "maximum data bytes" by 8: 1480/8 = 185 to get offset increment 4. Offset of each fragment "n" (n = 0, 1, 2, ...) = n x "offset increment": 0, 185, 370. ... 5. Length of each fragment (except last) = 20 + "max. data bytes" = 20 +1480 = 1500 Length of last fragment = 20 + remaining data bytes = 20 + 3980 - 2 x 1480 = 1040

  6. Fragmentation & Reassembly Stepsto remember: • Subtract 20 from original length: (bytes of "IP header data") • Subtract 20 from new MTU: (max. bytes of data in each fragment) • Divide "maximum data bytes" by 8: to get offset increment • Offset of each fragment "n" (n = 0, 1, 2, ...) = n x "offset increment" • Length of each fragment (except last) = 20 + "max. data bytes“ • Length of last fragment = 20 + remaining data bytes

  7. 40.0.0.7 40.0.0.0/12 MTU=900 30.0.0.7 30.0.0.0/15 MTU=1700 Router 1 50.1.0.8 40.0.0.8 60.2.0.0/17 MTU=800 Router 2 50.1.0.0/18 MTU=700 C1 Router 3 C2 50.1.0.9 60.2.0.9 Example: Fragmentation • Computer 1 sends a 1500 bytes datagram to C2. • Find the fragments that reaches C2

  8. 40.0.0.7 40.0.0.0/12 MTU=900 30.0.0.7 30.0.0.0/15 MTU=1700 Router 1 C2 50.1.0.8 40.0.0.8 60.2.0.0/17 MTU=800 Router 2 50.1.0.0/18 MTU=700 C1 Router 3 50.1.0.9 60.2.0.9 Example: Fragmentation Router 1: output MTU is 900. Datagram is 1500. 1500-20 = 1480 900-20 = 880 880/8 = 1101480 = 880 + 600  Two segments

  9. 40.0.0.7 40.0.0.0/12 MTU=900 30.0.0.7 30.0.0.0/15 MTU=1700 Router 1 C2 50.1.0.8 40.0.0.8 60.2.0.0/17 MTU=800 Router 2 50.1.0.0/18 MTU=700 C1 Router 3 50.1.0.9 60.2.0.9 Example: Fragmentation Router 2: output MTU is 700. Datagram 880 need to be fragmented

  10. Example: Fragmentation

  11. Fragmentation Complete Datagram To identify segments: • Flag = 0 • Offset = 0 • Flag = 1 • Offset = 0 • Flag ≠ 0 • Offset ≠ 0 • Flag = 0 • Offset ≠ 0 First segment Intermediate fragment Last fragment

  12. Reassembly fragmentation: in: one large datagram out: 3 smaller datagrams • different link types, different MTUs • large IP datagram divided (“fragmented”) within net • one datagram becomes several datagrams • “reassembled” only at final destination • IP header bits used to identify, order related fragments Blue: IP Header reassembly Another fragment flag, DNF (do not fragment) causes a ICMP response (and dropped datagram) instead of fragmentation. The sender then resends future datagrams with smaller size (may fragment itself or reduce MSS for TCP)

More Related