Forwarding, IPv4 & Addressing Flashcards
Network Layer (Function)
- Route packets end-to-end over a network, via multiple hops
- Ties the entire protocol stack together!
Network Layer (Key Challenges)
- How to represent addresses
- How to route packets in a scalable manner
The Internet Protocol (IP)
- Realistically, there’s only one globally applicable data-transfer protocol at the Network Layer: Internet Protocol (IP)
Routers Revisited
- LANs may be incompatible
¤ Ethernet, Wifi, etc… - How to connect them to form a network of networks?
- How do routers know where to send a packet?
IP Addressing (IPv4)
- 32-bit addresses
¤ Usually written in dotted notation, e.g. 192.168.21.76
¤ Each number is encoded as 8 bits
What should an address be associated with?
- Interface: connection between host/router and physical link
- Routers typically have multiple interfaces
- Host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11)
- IP addresses associated with each interface
How do we assign IP addresses?
- At the top level, IP address ranges are controlled by IANA
¤ Part of ICANN (The Internet Corporation for Assigned Names and Numbers) - IANA grants IPs to regional authorities
IP Addressing and forwarding
Flat IP Addressing does not scale well
- Routing Table Requirements
¤ For every possible IP, give the next hop
¤ But for 32-bit addresses, 232 possibilities (4,294,967,296) !
¤ Too slow - Hierarchical address scheme
¤ Separate the address into a network and a host
Classes of IP Addresses
Class Sizes
Classless Inter-Domain Routing (CIDR)
- Motivation: Offer a better tradeoff between size of the routing table and efficient use of the IP address space
- Key ideas: Flexible division between network and host addresses
¤ Get rid of IP classes
¤ Use a mask instead of fixed prefix
¤ A mask is a 32-bit number that determines the network part and the host part
CIDR Example
Subnets
- What’s a subnet ?
¤ Set of device interfaces that can physically reach each other without an intervening router
¤ Set of device interfaces whose IP address has a common network part
CIDR and Subnetting Improve Routing Scalability
Size of CIDR Routing Tables
- From www.cidr-report.org
- CIDR has kept IP routing table sizes in check
– Currently ~500,000 entries for a complete IP routing table
– Only required by backbone routers
IP functionality
- Getting the packet there:
¤ Where is the packet going (addressing)?
¤ Which protocol will process the packet on the destination host? - Network handling of packet:
¤ How should the packet be forwarded (e.g., priority)
¤ Where does the header end and the packet begin/end? - Coping with problems:
¤ Has the header been corrupted? (why not payload?)
¤ Has the packet been fragmented? If so, provide information needed to reconstruct
¤ Is packet caught in a loop? If so, drop packet
From semantics to syntax
- IP Datagrams are like a letter
¤ Totally self-contained
¤ Include all necessary addressing information
¤ No need for advanced setup of connections or circuits
IP Header Fields: Word 1
- Version: 4 for IPv4
- Header Length: Number of 32-bit words (usually 5)
- Differentiated Services Code Point/ Explicit Congestion Notification (not much used)
- Datagram Length: Length of header + data in bytes
IP Header Fields: Word 3
- Time to Live: decremented by each router
¤ Used to kill looping packets - Protocol: ID of encapsulated protocol
¤ 6 = TCP, 17 = UDP - Checksum
Problem: How to cope with
different MTUs?
- Each network has its own Maximum Transmission Unit size (MTU)
¤ IP Datagram size may be > MTU
¤ Minimum MTU may not be known for a given path - Solution: fragmentation
¤ Split datagrams into pieces when MTU is reduced
Where should reassembly happen?
- Answer #1: within the network, with no help from end- host B (receiver) ✗
- Answer #2: at end-host B (receiver) with no help from the network ✔
- Fragments can travel across different paths!
Fragmentation is Considered Harmful
Although IP’s “end-to-end” fragmentation is in keeping with the end-to-end principle, fragmentation is generally considered harmful - for two performance-related reasons:
- Fragmentation per-se adds performance overhead
- Loss of fragments leads to degraded performance
¤ Loss of any fragment requires retransmit of entire datagram
IPv6
- IPv6, first introduced in 1998(!)
¤ 128-bit addresses
¤ 4.8 * 1028 addresses per person - Address format
¤ 8 groups of 16-bit values, separated by ‘:’
¤ Leading zeroes in each group may be omitted
¤ Groups of zeroes can be omitted using ‘::’
2001:0db8:0000:0000:0000:ff00:0042:8329
2001:0db8:0:0:0:ff00:42:8329
2001:0db8::ff00:42:8329
IPv6 Header
- Double the size of IPv4 (320 bits vs. 160 bits)
Deployment Challenges
- Switching to IPv6 is a whole-Internet upgrade
¤ All routers, all hosts
¤ DNSv6, ICMPv6, DHCPv6, …
Google IPv6 Statistics
Beware unintended consequences of IPv6
- Performance during transition?
- “Tunnelling” has significant overheads
- IP blocklists
¤ Blocklists are used to track IPs of spammers/bots
¤ Few IPv4 addresses mean blocklist sizes are reasonable
– Hard for spammers/bots to acquire new IPs - Blocklists will not work with IPv6
¤ Address space is enormous
¤ Acquiring new IP addresses is trivial - How to manage subnet/IP allocation within networks?
- Much larger address space