IP Protocol

IP Datagram

Network layer header

Pasted image 20231018161741.png|500

Fragmentation & Reassembly

Network links have MTU (Max Transfer Size)
Large IP datagram divided within net

This lowers the probability of bit flips because the packet is smaller, net gain

High bandwidth low bit error probability send one giant packet
Low bandwidth high bit error probability fragment into small packets

Example:
4000 byte datagram with MTU = 1500 bytes

IP Addressing

IP address: 32-bit identifier for host, router, interface
Interface: connection between host/router and physical link

Each IP address has a

CIDR

Classless InterDomain Routing

Example:

11001000  00010111  00010000  00000000
<-------- subnet ---------><--- host--->
200.23.16.0/23

23 bits for subnet, 9 bits for host
This supports 29 devices within the same subnet

Getting an IP Address

Gets allocated portion of its provider ISP's address space

Example:
Alice's IP address 121.36.6.13
Bob's IP address 121.36.7.11
Are they in the same subnet? Depends on the subnet mask length.

ISPs get IP addresses through ICANN

Hierarchical Addressing

Hierarchical addressing allows efficient advertisement of routing information.

Upon changing ISP from Fly-By-Night-ISP (#1) to ISPs-R-Us (#2)
Pasted image 20231124173025.png|500

Network Address Translation (NAT)

All datagrams leaving local network have same single source NAT IP address, different source port numbers. Router maintains a redirection table, mapping a port number to the source port number.

Pasted image 20231023161621.png|390
Keeps that ports 5001 is for port 3345 on client side
Has to go into transport layer

16-bit port-number field (60,000 simultaneous connections with a single LAN-side address)

Internet Control Message Protocol (ICMP)

Used by hosts and routers to communicate network-level information

An ICMP message contains type, code plus first 8 bytes of IP datagram causing error

IPv6

Initial Motivation: 32-bit address space soon to be completely allocated
Additional motivation:

IPv6 datagram format:

IPv6 Header:

Other changes from IPv4:

Tunneling

Transition from IPv4 to IPv6