Transcript Document

CSS432 Internetworking
Textbook Ch4.1
Professor: Munehiro Fukuda
Augmented by Rob Nash
CSS432: Internetworking
1
Internetworks

Large scale & highly heterogeneous
 Bad
enough that it needs to host billions of
users
 But, we have to consider every type of
physical network hardware

Even those not yet invented?
CSS432: Internetworking
2
IP on Scale and Heterogeneity

While there are many ways to dissect and
tear apart the design decisions of the
“I”nternet…

The Internet is the only networking
technology to face such scale and
disparity (a perfect case study)
 Ok,
and IPX, but not to the same degree!
CSS432: Internetworking
3
Another Layer of Abstraction
VMs abstract OSes from Hardware
 DirectX abstracts graphics programmers
from various video card drivers
 IP abstracts upper level protocols from the
differences in FDDI, Ethernet, RPR, …

 Runs
on both routers and hosts
CSS432: Internetworking
4
IP Internet

Interconnected Collection of Networks


H7
R3
H8
Viewed as a simple logical network
H2
H1

Network 1 (Ethernet)
Routers: nodes interconnecting networks
H3
Network 4
(point-to-point)
Network 2 (Ethernet)
R1
Protocol Stack
R2
H4

IP on all nodes (both hosts and router)
 TCP and UDP on top of IP
Network 3 (FDDI)
H5
H1
H8
Identical packet
TCP
R1
IP
IP
ETH
H6
ETH
Identical frame
R2
Identical
datagram
FDDI
FDDI
IP
R3
Identical
datagram
PPP
PPP
IP
TCP
IP
ETH
ETH
Identical frame
CSS432: Internetworking
5
Service Model

Global addressing


Best-effort delivery (unreliable service)






IP address
Connectionless (datagram-based)
packets are lost
packets are delivered out of order
duplicate copies of a packet are delivered
packets can be delayed for a long time
Datagram format
Ex. Ethernet







src addr
0x0800
CRC
0
4
Version
Maximum header length?
TOS: type of service (priority queue in routers)
Length: packet length in bytes


dest addr
Version: IPv4/IPv6
HLen: header length in ints


preamble
frame type
Maximum packet size?
TTL: time to live (#hops)
Protocol: TCP, UDP
Checksum
SourceAddr: source IP address
DestinationAddr: destination IP address
CSS432: Internetworking
8
HLen
16
TOS
31
Length
Ident
TTL
19
Flags
Protocol
Offset
Checksum
SourceAddr
DestinationAddr
Options (variable)
Pad
(variable)
Data
6
Fragmentation and
Reassembly

Each network has some MTU (maximum
transmission unit)

To check each interface of your computer:



netstat –i
ifconfig
Strategy







fragment when necessary (MTU < Datagram)
try to avoid fragmentation at source host
re-fragmentation is possible
fragments are self-contained datagrams
use CS-PDU (not cells) for ATM
delay reassembly until destination host
do not recover from lost fragments
CSS432: Internetworking
7
Example
Start of header
Ident= x
0
Offset= 0
Rest of header
1400 data bytes
Start of header
Ident= x
H1
R1
R2
R3
H8
1
Offset= 0
Rest of header
512 data bytes
Start of header
ETH IP (1400)
FDDI IP (1400)
PPP IP (512)
ETH IP (512)
PPP IP (512)
ETH IP (512)
Rest of header
PPP IP (376)
ETH IP (376)
512 data bytes
Ident= x
1 Offset= 512
Start of header
Ident= x
0 Offset= 1024
Rest of header
376 data bytes
CSS432: Internetworking
8
Discussions
How can we detect if a given datagram
has lost some fragments?
 Who will take care resending a datagram
which could not be reassembled
previously due to its fragment droppings?

CSS432: Internetworking
9
Global Addresses

Properties
 globally
unique
 hierarchical: network + host

Dot Notation

A:
0
Class A
 1.0.0.1 – 126.255.255.254

(0.0.0.0 – 0.255.255.255, 1.0.0.0, 126.255.255.255,
and 127.0.0.0 – 127.255.255.255 reserved)
B:
7
24
Network
Host
1 0

Class B
 128.0.0.1 – 191.255.255.254
 Class C

C:
1 1 0
14
16
Network
Host
21
8
Network
Host
192.0.0.1 – 223.255.255.254
CSS432: Internetworking
10
Datagram Forwarding
Algorithm

If ( datagram’s dest network# == network# of network interface x )
deliver it to the destination host over interface x
else
if ( datagram’s dest network# == network# of a next hop router y)
deliver it to the router y
else
deliver it to its default router
Network 1
H1
Network 2
Example

R1
R2
R3
Network#
Next hop
Network#
Next hop
Network#
Next hop
1
R2
1
R3
1
Interface0
2
Interface1
2
R1
2
R2
3
Interface0
3
Interface1
3
R2
4
R2
4
Interface0
4
Interface1
CSS432: Internetworking
i/f 1
R1
i/f 0
H8
i/f 0
R3
i/f 1
i/f 0 Network 4
R2
i/f 1
Network 3
11
Static Configuration for
Cisco Routers
172.16.5.0/24
Eth2: 172.16.5.1
Router 2
Eth0: 172.16.1.2
172.16.3.0/24
Eth1: 172.16.3.1
Eth0: 172.16.3.2
Router 3
Eth1: 172.16.4.1
172.16.2.0/24
Eth1: 172.16.2.1
Router 1
hostname router1
Eht0: 172.16.1.1
!
interface ethernet 0
ip address 172.16.1.1 255.255.255.0
!
interface ethernet 1
ip address 172.16.2.1 255.255.255.0
!
ip route 172.16.3.0 255.255.255.0 172.16.1.2
ip route 172.16.4.0 255.255.255.0 172.16.1.2
ip route 172.16.5.0 255.255.255.0 172.16.1.2
CSS432: Internetworking
172.16.4.0/24
172.16.1.0/24
12
Address Translation

Map IP addresses into physical addresses



destination host
next hop router
Techniques

encode physical address in host part of IP address

Pha = f( IPa) or IPa =f-1(Pha)


Problems



Pha: 0010 0001 0100 1001 => 128.96.33.81
Class C has only 8 bits to indicate a host
Ethernet has 48 bits to present a host address
table-based


Resolution through dynamic binding
Address Resolution Protocol




table of IP to physical address bindings
broadcast request if IP address not in table
target machine responds with its physical address
table entries are discarded if not refreshed
CSS432: Internetworking
13
ARP Details
Reuqest I’m IPa and Pha. You’re IPb. How about Ph?
A
X
B
Y
IP
Ph
IP
Ph
IPa
Pha
IPb
Phb
IPb
??

Response I’m IPb and Phb. You’re IPa and Pha
A
X
B


Y
IP
Ph
IP
Ph
IPa
Pha
IPb
Phb
IPb
Phb
IPa
Pha
CSS432: Internetworking
table entries timeout in about
10 minutes
Update table with source when
you are the target, otherwise
no need to add an entry
update table if already have an
entry
14
ARP Packet Format






An ARP packet is carried in a frame header
HardwareType: type of physical network (e.g., Ethernet)
ProtocolType: type of higher layer protocol (e.g., IP)
HLEN & PLEN: length of physical and protocol addresses
Operation: request or response
Source/Target-Physical/Protocol addresses
frame type
Ex. Ethernet
preamble
dest addr
src addr
0
0x0806
8
CRC
16
Hardware type = 1
HLen = 48
PLen = 32
31
ProtocolT ype = 0x0800
Operation
SourceHardwareAddr (bytes 0 – 3)
SourceHardwareAddr (bytes 4 – 5) SourceProtocolAddr (bytes 0 – 1)
SourceProtocolAddr (bytes 2 – 3) TargetHardwareAddr (bytes 0 – 1)
TargetHardwareAddr (bytes 2 – 5)
TargetProtocolAddr (bytes 0 – 3)
CSS432: Internetworking
15
RARP: Reverse Address
Resolution Protocol

Request I’m Pha. What’s my IPa?
A
X
B
Y
RARP server
IP
Ph
??
Pha


IP
Ph
IPa
Pha

IPb
Phb

Response You’re IPa and Pha
A
X
IP
Ph
IPa
Pha
B
Y

RARP server
IP
Ph
IPa
Pha
IPb
Phb
CSS432: Internetworking
Use RARP if a client host is
diskless workstation
Use the unique MAC address
Ask an RARP server about a
client IP.
Works in the same LAN
Retransmit an RARP message
after a large delay if it has been
lost.
Prepare a primary and secondary
server.
16
DHCPBroadcast
DHCP
relay
Host

datagram
Other network
UDP header
DHCP
server
Unicast
DHCP server:






Frame addr
Works as a centralized repository for IPs
Pools available IP addresses
Hands out one to a client on demand
Accessible by sending a DHCPDISCOVER message
to an IP broadcast address
Receives a DHCPDISCOVER from a Relay agent
connected to a different network (255.255.255.255)
BOOTP/DHCP
OP
Htype
HLEN HOPS
Xid
Secs
Flags
Client IP addr
Your IP addr
Server IP addr
Router IP aaddr
Client Hardware addr
Server host name
Boot file name
Options
Advantages:

Works at a user level
 Automatic IP configuration
 Save IP addresses
 Works across networks.
CSS432: Internetworking
17
DHCP Client State Transition
Host boots
INITIALIZE
/ DHCPDISCOVER to all servers
SELECT
Receive DHCPOFFER
from all servers
Select offer / DHCPREQUEST to a specific server
DHCPNACK
Or
Lease expires
REBIND
DHCPNACK
Lease reaches 87.5% expiration
/ DHCPREQUEST to any server
RENEW
DHCPACK
DHCPACK
REQUEST
Lease reaches 50% expiration
/ DHCPREQUEST to the current server
Receive DHCPACK from the current server
BOUND
Fig. 23.4 on p453 of Internetworking with TCP/IP
CSS432: Internetworking
18
Another View…

http://www.tcpipguide.com/free/t_DHCPGe
neralOperationandClientFiniteStateMachin
e.htm
CSS432: Internetworking
19
Two-Step bootstrap Procedure
BOOTP server
Step 1A: BOOTP request: BOOT FILE NAME=I want to boot “unix”
Diskless Workstation
Step 1B:
BOOTP reply: Server = mercury, BOOT FILE NAME=“/local/var/bootfiles/xncd19r”
Step 2A: TFTP request: request for the image
File server
Step 2B: TFTP reply: image returned
OS Image:
Unix
Windows
CSS432: Internetworking
20
Internet Control Message
Protocol (ICMP) (CompanionP)
An error reporting message (ICMP)
Error occurred
Src
R1
R2
R3
RK
Rcv
Is Src responsible for this ICMP message?
RE Mistakenly routed
frame header
datagram heaader
ICMP header
ICMP data
ICMP type 0-18
CSS432: Internetworking
21
ICMP Message Types
Type field
Code field ICMP Message Type
0 and 8
Echo reply/request
3
Destination unreachable
5
Redirect (change a route)
11
0
TTL exceeded
11
1
Fragment reassemble failed
CSS432: Internetworking
Applications
ping
Trace route,
22

Reviews
 IP
Internet: Protocol stack,
fragmentation/reassembly, IP address, and
datagram forwarding
 Address translation: ARP, RAPR, and DHCP
 ICMP

Exercises in Chapter 4
 Ex.
4 (fragmentation)
 Ex. 13 (ARP)
 Ex. 14 (ARP)
CSS432: Internetworking
23

More Exercises (not from Our Textbook)
 Q1.

Consider a host that has a disk and uses DHCP to
obtain an IP address. If the host stores its address on
disk along with the data the lease expires, and then
reboots within the lease period, can it use the same
address? Why or why not?
 Q2.

(DHCP)
(DHCP)
DHCP mandates a minimum address lease of one
hour. Can you imagine a situation in which DHCP’s
minium lease causes inconvenience? Explain.
CSS432: Internetworking
24