Sei sulla pagina 1di 31

The Internet Protocol - IPv4

Lars M. Kristensen
Department of Computer Science
University of Aarhus
Denmark

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 1
The Internetworking Model
ƒ Transparent interconnection of heterogeneous physical
networks into a single uniform and virtual network
Application
Protocol layer

Internet Protocol
layer

Network Interface
layer

Abstraction (TCP/IP software)

Basic Network Level Services:


ƒ Connectionless Packet Delivery Service (IP/UDP)
(loss, duplication, and reordering).
ƒ Reliable Stream Transport Service (IP/TCP).
UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 2
Internet Addressing

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 3
Internet Addressing
ƒ Main goals:
ƒ Universal: hosts must be globally addressable.
ƒ Routing/forwarding must be efficient.

ƒ Basic idea:
ƒ Each host is assigned a 32-bit internet address.
ƒ Addresses consists of a network identifier (prefix) and a host
identifier (suffix).

ƒ Dotted decimal notation:


ƒ Addresses by convention divided into 8-bit blocks and written in
decimal notation separated by dots (.):
ƒ Example:
10000000000010100000001000011110
10000000 00001010 00000010 00011110
128.10.2.30

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 4
Original Classful Internet
Addressing Scheme
ƒ Physical networks will have different number of hosts
attached:

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 5
Special Addresses
ƒ Network address:
ƒ All bits for host identifier equal to 0.
ƒ Example (class B network): 192.255.0.0

ƒ Directed broadcast (all hosts on a specified network):


ƒ All bits for host identifier equal to 1.
ƒ Usually implemented via hardware broadcast (if supported).
ƒ Example (class B Network) : 192.254.255.255

ƒ Limited broadcast (all host on local network):


ƒ All address bits set to 1: 255.255.255.255

ƒ Startup source address:


ƒ All address bits set to 0: 0.0.0.0
ƒ Use for identification when host has not yet an IP address.

ƒ Loopback address:
ƒ Network prefix 127.0.0.0
ƒ For testing and interprocess communication purposes on a machine.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 6
Example

Questions:
ƒ Network address?
ƒ Network class?
ƒ Limited broadcast?
ƒ Directed broadcast?

ƒ IP addresses identifies network connections (interfaces).

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 7
Discussion
ƒ Unique network prefix for each physical network quickly
exhausts the address space.
ƒ Subnetting alleviates this.

ƒ Static classful hierarchy leads to poor utilisation of the


address space.
ƒ Classless addressing alleviates this.

ƒ IP adresss of a host must be changed if moved to another


physical network.
ƒ Mobile IP developed to support mobile hosts.

ƒ IP addresses identifies network connections (interfaces).

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 8
Address Resolution

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 9
The Problem
ƒ Communication on the physical networks uses physical
network addresses (e.g., Ethernet):

ƒ Communication in an IP network uses IP addresses.

ƒ Address Resolution Problem: Mapping from IP addresses to


physical addresses.
UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 10
The Address Resolution Protocol
ƒ Request-reply protocol:
ARP request (broadcast)

ARP reply (unicast)

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 11
ARP Protocol
ƒ ARP cache:
ƒ Contains recently acquired IP-to-physical address bindings.
ƒ Each cache entry has an associated timeout (~ 20 minutes).
ƒ Reduces the number of broadcasts and delay.

ƒ Further refinements:
ƒ Sender IP address typically contained in the ARP request.
ƒ Gratuitous ARP request broadcast to inform of a new physical
address.
ƒ Early revalidation: refresh cache entry before timeout to
avoid jitter (delays).

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 12
ARP Protocol Format

HARDWARE TYPE: type of physical network (1 for Ethernet).


PROTOCOL TYPE: higher-level protocol (0800 for IP).
HLEN: length of hardware addresses.
PLEN: length of higher-level protocol addresses.
OPERATION: ARP request(1), ARP response (2).
UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 13
ARP Operation

ARP request (broadcast)

ARP reply (unicast)

Question:
ƒ Sender HA/IP?
ƒ Target HA/IP?

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 14
Example

ƒ ARP messages for transmission of an IP datagram from


host Lancelot to host Arthur via router Taliesyn?
UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 15
IPv4: Connectionless
Datagram Delivery

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 16
The Internet Protocol
Service provided:
ƒ Unreliable: loss, duplication, delay, out-of-order delivery.
ƒ Connectionless: each datagram (packet) treated independently.

Protocol components:
ƒ Packet format: basic units of data transfer in an TCP/IP
internet.
ƒ Rules for forwarding of packets across multiple physical
networks.
ƒ Rules for packet processing and error signalling.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 17
The IPv4 Datagram

ƒ IP header is at least 20 octets.


ƒ Maximum datagram size is 65,535 octets.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 18
Fragmentation
ƒ Maximum transfer units (MTU) differs between physical
networks:

ƒ Multiple frames may be required to transmit the IP


datagram.
UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 19
Fragmentation
Original IP datagram

IP datagram 1

IP datagram 2

IP datagram 3

ƒ IDENTIFICATION field used to group fragments belonging to the


same original IP datagram.
ƒ FRAGMENT OFFSET specifies offset in original datagram.
ƒ FLAGS used to tag the last fragment.

Reassembly is only done at the final destination.


UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 20
IP Datagram Options

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 21
Forwarding IP Datagrams

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 22
IP Forwarding Basics
ƒ Direct delivery (by host or router):
ƒ IP destination of the datagram is on the same physical network.
ƒ The network prefix can be used to determine whether direct
delivery is possible.

ƒ Indirect delivery (by host):


ƒ IP destination of the datagram is not on the same physical network.
ƒ IP datagram is passed on to a router which forwards the datagram
towards the destination network.

ƒ Forwarding based upon the contents of routing tables.


ƒ Content of routing tables computed by routing algorithms.
ƒ Routing tables contains pairs consisting of a network prefix and a
next-hop router IP address.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 23
Routing Example

ƒ Size of routing tables independent of the number of hosts.


ƒ Routing table may also contain a default route.
ƒ Routing table may also contain host routes.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 24
Forwarding Algorithm

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 25
Forwarding and Addressing

Computer
Computer

10.0.0.4 40.0.0.8

10.0.0.4
40.0.0.8

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 26
ICMP:
Error and Control Messages

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 27
Internet Control Message
Protocol (ICMP)
ƒ Protocol for control and error reporting among
hosts and routers.
ƒ ICMP messages encapsulated in IP datagrams:

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 28
ICMP Message Types

ƒ Examples of use:
ƒ Testing reachability (ping).
ƒ Reporting an unreachable
destination.
ƒ Tracing a route (traceroute).

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 29
Summary
ƒ Internet Addressing:
ƒ Division into network prefix and host suffix.
ƒ IP addresses identifies network connections (interfaces).

ƒ Address Resolution:
ƒ ARP Protocol for mapping IP addresses to physical addresses.

ƒ IP Protocol:
ƒ Unreliable connectionless delivery of datagrams.

ƒ IP Datagram Forwarding:
ƒ Forwarding based on routing tables computed by routing protocols.
ƒ Routing table entries are pairs (network prefix, next-hop IP address).

ƒ Error and Control Messages:


ƒ ICMP Protocol for control, error reporting, and diagnostics.

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 30
Introduction to project 1

www.daimi.au.dk/NPaI/project1.html

UNIVERSITY OF AARHUS

Department of Computer Science Network Protocols and Internetworking


03/09/2007 - 31

Potrebbero piacerti anche