The TCP/IP Protocol Suite: IP
Derek Bridge
Department of Computer Science,
University College Cork
The TCP/IP Protocol Suite: IP
Aims:
- to know about IP addresses
- to know how routing works on the Internet
The Internet Protocol (IP)
- IP is concerned with routing
- Among other things, it specifies:
- how to uniquely identify devices on the Internet
(using IP addresses), and
- how to choose the route that a packet takes
IP datagrams
Each IP datagram will consist of two parts:
- a header, which includes:
- the IP address of the destination device
- the IP address of the source device (the sender)
- the data (in fact, a TCP segment)
Class exercise: Why include the address of the source?
Time To Live (TTL)
- The IP datagram header also contains a positive integer, its TTL
- Each router that the datagram passes through decrements the TTL
- If the TTL reaches zero, the datagram is discarded
Class exercise: Why is the datagram discarded?
How does this relate to our previous lecture?
IP addresses
- Every device on a network has a hardware address,
unique to that network (at least)
- But we need an address that is unique across the whole Internet
- Hence, every device is assigned a unique 32-bit IP address
- Most commonly, we write IP addresses in dotted decimal notation
- E.g.
11100011 01010010 10011101 10110001 | 227.82.157.177 |
IP addresses
- Network identifier (network id, network prefix)
- A certain number of bits, starting from the
left, identifies the network to which the host is attached
- Host identifier (host id)
- The remainder of the bits identify the host on the network
The dividing line between the two varies from network to network
E.g. 227.82.157.177/20 means the first 20 bits are network id
Class exercise:Why have mobile devices proved
problematic?
IP address registration
IP addresses used to be handed out by a single, central organisation,
the Internet Assigned Number Authority (IANA)
- We need a central authority. Why?
- But it should hand out addresses in blocks. Why?
A hierarchy of Internet registries
- Nowadays, the IANA (http://www.iana.org/)
gives blocks of addresses to...
- ...the Regional Internet Registries (RIRs), e.g. the RIPE NCC
(http://www.ripe.net/), which give blocks to...
- ...National Internet Registries (NIRs) and Local Internet Registries (LIRs), e.g.
HEAnet (http://www.heanet.ie/), which
give blocks to...
- ...end-user organisations, perhaps going through several levels of ISP also!
- You go to a registry and ask for a block of addresses of the size
you think you need
Assigning IP addresses to hosts
- Static IP address assignment
- Each host is manually configured with its IP address, which does not change
for as long as the host uses this network
- Dynamic IP address assignment
- A computer connected to the network (often the local router) has a pool of
IP addresses. It allocates them to hosts on an as-needed basis
Class exercise:Why do you think
dynamic assignment has become ever more commonplace?
Delivering a datagram
Diagram of datagram delivery from The TCP/IP Guide by Charles M. Kozierok
Choosing the next router
- Each router has a routing table
- Each entry in the table says
If the ultimate destination is on the following network, the next hop
you should take is to the following router
- Routers exchange information in order to improve the entries in their
tables
Choosing the next router
Diagram of datagram routing from The TCP/IP Guide by Charles M. Kozierok
IPv4 and IPv6
- IPv4 uses 32-bit IP addresses
232 = 4,294,967,296
- IPv6 uses 128-bit IP addresses
2128 = 340 trillion, trillion, trillion
- IPv6 also has better support for security, mobile computing...
My journey across the Internet by A. Packet
Diagram of packet delivery from The TCP/IP Guide by Charles M. Kozierok