Upload
martha-chandler
View
217
Download
0
Embed Size (px)
DESCRIPTION
3 2. The IP service model The IP service model consists of –an addressing scheme to identify an IP host, and –a datagram (connectionless) model of data delivery. IP provides a best-effort service. –IP makes its best effort to send a datagram to its destination. –The best-effort service does not guarantee reliable datagram delivery, i.e., an unreliable service.
Citation preview
1
Chapter 4: Internetworking(Internet Protocol)
Dr. Rocky K. C. Chang16 March 2004
2
1. The IP technology (except routing)• IP service model• IP protocol family• IP datagram structure• IP datagram fragmentation and reassembly• IP subnets• IP forwarding mechanisms• IP tunnels• Other IP layer protocols
3
2. The IP service model• The IP service model consists of
– an addressing scheme to identify an IP host, and– a datagram (connectionless) model of data delivery.
• IP provides a best-effort service.– IP makes its best effort to send a datagram to its
destination.– The best-effort service does not guarantee reliable
datagram delivery, i.e., an unreliable service.
4
3. Internet protocol suite (incomplete)
…
FTP HTTP NV TFTP
TCP UDP
IP
NET1 NET2 NETn
Application
Transport
Network
Data-link
ICMP IGMP
ARP & RARP
Ping DNS
RTPSSL
5
4. IP datagram
Version HLen TOS Length
Ident Flags Offset
TTL Protocol Checksum
SourceAddr
DestinationAddr
Options (variable) Pad(variable)
0 4 8 16 19 31
Data
6
4. IP datagram• Version: 4 for the current IP.• Type of service (TOS) for specifying how a
router should handle this datagram.• Header length handles a variable-length header.
– 20-byte IP header without IP options• A 16-bit length limits the size of an IP datagram
to 65,535 bytes, including the IP header.• Identification, flags, and offset are used for
packet fragmentation and reassembly.
7
4. IP datagram• Time to live (TTL) limits the the number of
times that a datagram processed by routers.• Protocol specifies the type of payload, e.g., 6
for TCP and 17 for UDP.• Checksum is a 16-bit word checksum.• IP options, e.g.,
– Source routing– Record route
8
5. MTU and packet fragmentation• Each network chooses a maximum packet size
that can be sent on it, Maximum Transmission Unit (MTU). For example,– 1500 bytes for 10-Mbps Ethernet– 4352 bytes for FDDI– 17914 bytes for 16-Mbps token ring
• Note that all MTUs are smaller than IP datagram’s maximum size.
• One internetworking problem is to accommodate various MTU values.
9
5. MTU and packet fragmentation• To send datagrams to a directly attached host,
use the network’s MTU.• To send datagrams to a nondirectly attached
host, use the path MTU.– Path MTU is the minimum of the networks’ MTUs
on the path from the source to destination.• If the actual MTU used is larger than the path
MTU, packet fragmentation occurs.– Fragmentation occurs when a router attempts to
forward it to a network with a smaller MTU.
10
5. MTU and packet fragmentation
H1 R1 R2 R3 H8
ETH IP (1400) FDDI IP (1400) PPP IP (512)
PPP IP (376)
PPP IP (512)
ETH IP (512)
ETH IP (376)
ETH IP (512)
11
Ident = x Offset = 0
Start of header
0
Rest of header
1400 data bytes
(a)
Ident = x Offset = 0
Start of header
1
Rest of header
512 data bytes
(b)
Ident = x Offset = 512
Start of header
1
Rest of header
512 data bytes
Ident = x Offset = 1024
Start of header
0
Rest of header
376 data bytes
12
5. MTU and packet fragmentation• Each IP fragment contains enough information
for forwarding to the destination.• A fragmented IP datagram will be reassembled
only at the destination node.• If any fragments do not arrive within a certain
time, other received fragments in the datagram will be discarded.
• Fragmentation could occur multiple times to an IP datagram.
13
6. IP subnets• IP subnets introduce additional levels within an
IP network:– A network address, a subnet ID, and a host ID.
• IP subnets offer flexibility in allocating addresses to different sizes of sub-networks.
• A subnet mask is used to indicate which bits are referred to the network and subnet ID.– Each network interface stores subnet mask and its
unicast IP address.
14
6. IP subnets• Subnetting for a class B address:
Network number Host number
Class B address
Subnet mask (255.255.255.0)
Subnetted address
1111111111111111 11111111 00000000
Network number Host IDSubnet ID
15
6. IP subnetsSubnet mask: 255.255.255.128Subnet number: 128.96.34.0
128.96.34.15128.96.34.1
H1R1
128.96.34.130 Subnet mask: 255.255.255.128Subnet number: 128.96.34.128
128.96.34.129128.96.34.139
R2H2
128.96.33.1128.96.33.14
Subnet mask: 255.255.255.0Subnet number: 128.96.33.0
H3
16
7. IP forwarding mechanisms• Assume that both routers and hosts already
have appropriate routing tables in place.– Routing tables for routers are constructed from
routing protocols.– Routing tables for hosts are constructed from other
means.• Problem: Given a routing table, how do hosts
and routers forward datagrams?
17
7.1 Examples of routing tables• For example, R1’s routing table:
– Network/Subnet Subnet Mask Next Hop– 128.96.34.0 255.255.255.128 upper int.– 128.96.34.128 255.255.255.128 lower int.– 128.96.33.0 255.255.255.0 128.96.34.129
• For example, H1’s routing table:– Network/Subnet Subnet Mask Next Hop– 128.96.34.0 255.255.255.128 upper int.– 0.0.0.0 0.0.0.0
128.96.34.1
18
7.2 Host’s forwarding mechanisms• A host sends a datagram to another host on the
same LAN or not.– In the former, it sends the datagram to the
destination directly.– In the latter, it sends the datagram to a default
router.– In both cases, the host uses ARP cache or ARP to
find out the corresponding MAC addresses.
19
7.3 A general forwarding mechanism
D = Destination IP address
for each entry (Network/Subnet ID, Subnet Mask, Next Hop)
D1 = Subnet mask & D
if D1 = Network/Subnet ID
if Next Hop is an interface
deliver datagram directly to destination
else
deliver datagram to Next Hop (a router)
20
7.4 Characteristics of IP forwarding• Both hosts and routers are involved in
forwarding.– Compared with routers, a host makes a much
simpler binary decision. • IP forwarding is done on a hop-by-hop basis.• It is assumed that the next-hop router is really
closer to the destination.• IP forwarding is able to specify a route to a
network, and not have to specify a route to every host.
21
8. IP tunnels• Two network nodes (hosts or routers) may
“tunnel” IP datagrams between them.– Other nodes on the path are not aware of the other
datagram encapsulated by the outer datagram.– A tunnel configured from R1 to R2, which is
assigned with a virtual number of 0:• Network Next Hop• 1 Interface 0• 2 Virtual interface 0• Default Interface 1
22
8. IP tunnels• Network interfaces configured as tunnel
endpoints perform IP-in-IP encapsulation.– When sending datagrams to each other, the sender
uses its IP address as the source address and the other’s IP address as the destination address.
– Each performs IP-in-IP encapsulation/decapsulation and then IP routing.
– A datagram may traverse several IP tunnels before arriving at the destination.
23
8.1 An example of IP tunnels
IP header ,Destination = 2.x
IP payload
IP header ,Destination = 10.0.0.1
IP header ,Destination = 2.x
IP payload
IP header ,Destination = 2.x
IP payload
Network 1 R1 Internetwork Network 2R2
10.0.0.1
24
8.2 Uses of IP tunnels• Mobile IP: IP tunnel between a foreign agent
(or a mobile host) and a home agent.• Mbone (Multicast backbone): IP tunnels
connect islands of multicast-enabled IP networks.
• IPv6: IP tunnels will be used for IPv4-IPv6 transition.
• IPSec: IP tunnels with security is used in establishing Virtual Private Networks (VPNs).
25
8.3 Virtual private networksC
A
Corporation X private network
B
K L
M
Corporation Y private network
C
A B
K L
M
Physical links
Physical links
Virtual circuits
(a)
(b)
26
9. Dynamic host configuration protocol• DHCP provides a framework for passing
configuration information to hosts.– IP addresses, address of a default router, etc.
• DHCP is a client-server system, including a relay agent.
• DHCP operation:– A DHCP client initially broadcasts a DISCOVER
message to find a DHCP server.• If the server is not directly connected to the client, a relay
agent on the LAN will forward this message to the server.
27
9. Dynamic host configuration protocol– The server sends an OFFER message back to the
relay agent, which then forwards it in either unicast or broadcast back to the client.
– Upon accepting an OFFER from a DHCP server, the client sends a REQUEST message to that server.
– The final step is for the server to send a REQUEST ACK back to the client.
• DHCP provides IP addresses to clients for a finite lease duration.– The client either renews the lease or rebinds to
another new address.
28
9. Dynamic host configuration protocol
DHCPrelay
DHCPserver
Other networks
Unicast to server
Broadcast
Host
29
10. Internet control message protocol• The main functions associated with the ICMP
are error reporting, reachability test, and route-change notification.
• ICMP reports errors to the source for host unreachable, lost of fragments, etc.
• Ping program uses ICMP echo request and reply to test a host’s aliveness.
• ICMP sends a re-direct message for a better route back to the source.
30
10. Internet control message protocol
Host
R1 R2
(1) IP datagram
(2) IP datagram
(3) ICMP redirect
to the destination