Docsity

Packets and Routers - Networking - Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Packets and Routers - Networking - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

The IP Data Plane:

Packets and Routers

The IP layer

  • So far, we’ve focused mostly on routing protocols
    • how routers discover and select end-to-end paths
    • part of a network’s control plane
  • Today: the data plane
    • what data packets look like at the IP layer (the IP header)
    • how routers forward these IP packets

What is Designing IP?

  • Syntax: format of packet
    • Nontrivial part: packet “header”
    • Rest is opaque payload (why opaque?)
  • Semantics: meaning of header fields
    • Required processing

Header

Opaque Payload

Packet Headers

  • Think of packet header as interface
    • Only way of passing information from packet to switch
  • Designing interfaces
    • What task are you trying to perform?
    • What information do you need to accomplish it?
  • Header reflects information needed for basic tasks

IP Packet Structure

4 - bit

Version

4 - bit

Header

Length

8 - bit

Type of Service

(TOS)

16 - bit Total Length (Bytes)

16 - bit Identification

3 - bit

Flags

13 - bit Fragment Offset

8 - bit Time to

Live (TTL)

8 - bit Protocol 16 - bit Header Checksum

32 - bit Source IP Address

32 - bit Destination IP Address

Options (if any)

Payload

20 Bytes of Standard Header, then Options

4 - bit

Version

4 - bit

Header

Length

8 - bit

Type of Service

(TOS)

16 - bit Total Length (Bytes)

16 - bit Identification

3 - bit

Flags

13 - bit Fragment Offset

8 - bit Time to

Live (TTL)

8 - bit Protocol 16 - bit Header Checksum

32 - bit Source IP Address

32 - bit Destination IP Address

Options (if any)

Payload

Reading Packet Correctly

  • Version number (4 bits)
    • Indicates the version of the IP protocol
    • Necessary to know what other fields to expect
    • Typically “ 4 ” (for IPv4), and sometimes “ 6 ” (for IPv6)
  • Header length (4 bits)
    • Number of 32-bit words in the header
    • Typically “ 5 ” (for a 20-byte IPv4 header)
    • Can be more when IP options are used
  • Total length (16 bits)
    • Number of bytes in the packet
    • Maximum size is 65,535 bytes (

16

  • … though underlying links may impose smaller limits

Fields for Reaching Destination and Back

4 - bit

Version

4 - bit

Header

Length

8 - bit

Type of Service

(TOS)

16 - bit Total Length (Bytes)

16 - bit Identification

3 - bit

Flags

13 - bit Fragment Offset

8 - bit Time to

Live (TTL)

8 - bit Protocol 16 - bit Header Checksum

32 - bit Source IP Address

32 - bit Destination IP Address

Options (if any)

Payload

Telling End-Host How to Handle Packet

  • Protocol (8 bits)
    • Identifies the higher-level protocol
    • Important for demultiplexing at receiving host

Application

Transport

Network

Data link

Physical L

L

L

L

L7 SMTP

HTTP DNS NTP

TCP UDP

IP

Ethernet FDDI PPP

optical copper radio PSTN

Telling End-Host How to Handle Packet

  • Protocol (8 bits)
    • Identifies the higher-level protocol
    • Important for demultiplexing at receiving host
  • Most common examples
    • E.g., “ 6 ” for the Transmission Control Protocol (TCP)
    • E.g., “ 17 ” for the User Datagram Protocol (UDP)

IP header IP header

TCP header UDP header

protocol=6 protocol=

Checksum, TTL and Fragmentation Fields

4 - bit

Version

4 - bit

Header

Length

8 - bit

Type of Service

(TOS)

16 - bit Total Length (Bytes)

16 - bit Identification

3 - bit

Flags

13 - bit Fragment Offset

8 - bit Time to

Live (TTL)

8 - bit Protocol 16 - bit Header Checksum

32 - bit Source IP Address

32 - bit Destination IP Address

Options (if any)

Payload

Header Corruption (Checksum)

  • Checksum (16 bits)
    • Particular form of checksum over packet header
  • If not correct, router discards packets
    • So it doesn’t act on bogus information
  • Checksum recalculated at every router
    • Why?
    • Why include TTL?
    • Why only header?

Fragmentation

  • Fragmentation: when forwarding a packet, an Internet

router can split it into multiple pieces (“fragments”) if

the packet is too big for next hop link

  • too big  exceeds the link’s “Max Transmission Unit” (MTU)
  • Must reassemble to recover original packet
  • Need fragmentation information (32 bits)
  • Packet identifier, flags, and fragment offset
  • Details in Section

Fields for Special Handling

4 - bit

Version

4 - bit

Header

Length

8 - bit

Type of Service

(TOS)

16 - bit Total Length (Bytes)

16 - bit Identification

3 - bit

Flags

13 - bit Fragment Offset

8 - bit Time to

Live (TTL)

8 - bit Protocol 16 - bit Header Checksum

32 - bit Source IP Address

32 - bit Destination IP Address

Options (if any)

Payload