inter-networking - seoul national universityincpaper.snu.ac.kr/images/7/76/inter_networking.pdf ·...
TRANSCRIPT
SNU SCONE lab. 2
Routing Within a LAN MAC Address
– Each station (or network interface) should be uniquely
identified
– Use 6 byte long address
Broadcast & Filter
– Broadcast medium
• Signals are transmitted to all stations
A DB C YX
Suppose B X
B specifies X’s address in a frame
All stations receive the frame, but only X filters in the frame
Interconnection Devices
H HB Router
H HHHRouter
Extended LAN =
Broadcast domain
LAN = MAC domain
Application
Transport
Physical
Data Link
Network
Application
Transport
Physical
Data Link
Network
Repeater
Bridge/Switch
Router
Gateway
The Internet Provides world-wide end-to-end
connections
Need to Inter-connect many small
networks
Inter-connection
devices
SNU SCONE lab.
Interconnection Device - Repeater
Repeater
– Physical layer device that restores and
relays signals
Hub
– Multiport repeater + Fault detection & recovery
Limitations of repeater
– Collision domain
– Physical limitations
• Ethernet – 2500 meter max. distance
Single Collision Domain
Bridge
– Store and forward: relay frames if needed obeying MAC protocol
– Extended LAN
– Propagate MAC multicast/broadcast frames
Switch (layer 2)
– Multiport bridge with parallel
paths
– Full duplex link
Interconnection Device - Bridge
a b c d e f g h i
Bridge manages filtering DB
SNU SCONE lab.
Bridge - Routing
SNU SCONE lab. 6
Bridge maintains routing
information
Questions
1. How to obtain the routing Information?
2. What if a node migrate to other network?
3. What mechanism to use to purge old information?
STP
Bridge floods frames
– Unknown destinations
– Multicast/Broadcast
Infinite packet circulation if
a network has physical loops
Build a virtual tree on top of non-tree network
STP (Spanning Tree Protocol)
SNU SCONE lab. 7
SNU SCONE lab. 8
Interconnection Devices – Router &
Others
Router
– Network layer device
– Does not propagate MAC multicast
Layer N switch
Gateway
– Transport & upper layer devices
Data Link Protocols
Protocols
– HDLC
– LAP-b
– LLC
Functions
– Framing
– Error control
– Flow control
– MAC
Design
SNU INC lab. 9
SNU SCONE lab.
Network Layer
Functions
– Construction of a logical network connecting multiple
physical networks
• internetwork, internet
– End-to-end (host) packet delivery
Physical Network
Logical Network
NetworkRouter (Gateway)
- Routing
- Arbitrate difference between
two physical networks
(internetwork, internet)
Layer 4~N
Layer 1/2
SNU SCONE lab.
IP Packet Delivery Model
Datagram (not Virtual Circuit)
– No connection setup (Read Textbook, Section 3.1)
Best-effort (no guarantee)
– Lost packets
– Out-of-order delivery
– Packet duplication
– Delayed delivery
IP works on any hardware (Phy. Network) technologies
– IP over X
Design Goal: Be FLEXIBLE enough to support any
underlying network technologies.
SNU SCONE lab.
IP Address
Routing ≈ Addressing
Each Internet host has a universally unique IP address
Format
– 4 bytes
– Hierarchical
• Network ID & Host ID
Each (physical) network has a unique network ID
– Assign unique host IDs to the hosts within the same (physical)
network
Net ID Host ID
IP address NotationBinary
- 11000000 00000101 00110000 00000011
Dotted decimal
- 192.5.48.3
SNU SCONE lab.
IP Address Classes
0 Net ID Host ID
1 0 Net ID Host ID
1 1 0 Net ID Host ID
1 1 1 0 Multicast Address
Class A
Class B
Class C
Class D
Class Range (First Byte)
A 0 - 127B 128 - 191C 192 - 223D 224 - 239E 240 - 255
One network ID is allocated to
an physical network
In reality: A Class A or B network ID is
allocated to an organization or to an
AS with many physical networks
SNU SCONE lab.
Special IP Addresses
All-0s– This host
All-1s– All hosts on this net
– Limited broadcast
All-0 host suffix– Network address
All-1 host suffix– All hosts in the specified net
– Directed broadcast
127.*.*.*– Loopback through IP layer
IP Addressing All hosts on a same physical network have the same
network ID(prefix)
147.46.0.0147.47.0.0
192.5.48.0
10.0.0.0
147.46.0.3
147.46.214.5
10.0.64.1
10.10.0.7
192.5.48.24
147.47.0.3
How about the host(router) w/
more than one interfaces?
147.46.a.b 147.47.c.d
SNU SCONE lab.
Internetworking with Routers
Ethernet
A
Z B
X Y Point-to-
point
Ethernet
FDDI
TCP
IP
ETH
IP IPIPIP
ETH ETH ETHP2PP2PFDDIFDDI
TCP
Flight of a packet from A to B
X Y ZA B
SNU SCONE lab.
IP Routing (Forwarding)
Direct and Indirect delivery
– Direct: Source & destination are in the same physical network
– Indirect: Source & destination are on different physical
networks
Case 1: Host a --> Host b
Host a knows that host b is in the same physical network
How?
Case 2: Host a --> Host c
Host a relay datagram to router A or B
C
d
b
a
F
E
D
B
A
c
50.0.0.1
40.0.0.5
10.0.0.5
10.0.0.1
30.0.0.0
20.0.0.0
10.0.0.0
40.0.0.0
50.0.0.0
Routers (Hosts also) manage directives called
Forwarding Table that shows best routes to
destinations
To reduce the forwarding table size (scalability), route
based on networks, not hosts
Hop by hop
forwarding
– A forwarding table
indicates the very next
hop router on the path
to destination
(compare to Source
Routing)
SNU SCONE lab.
Forwarding Table - 1
19
Forwarding Table - 2
Format
– <Destination ID, next hop>
– Usually, destination ID is the network ID
Forwarding table
at host a
Dest. Next hop
10.0.0.0
20.0.0.0
30.0.0.0
40.0.0.0
50.0.0.0
Direct Delivery
Router B
Router A
Router B
Router A
C
d
b
a
F
E
D
B
A
c
50.0.0.1
40.0.0.5
10.0.0.5
10.0.0.1
30.0.0.0
20.0.0.0
10.0.0.0
40.0.0.0
50.0.0.0
IP address of Router B’s
interface to a network
10.0.0.0
SNU SCONE lab. 20
Forwarding Table - 3
Further size reduction
– Default route
Search sequence is important
– List specific routes first
– Search from top to bottom
Forwarding table
at host a
Dest. Next hop
10.0.0.0
20.0.0.0
40.0.0.0
Default
Direct Delivery
Router B
Router B
Router A
Dest. Next hop
10.0.0.0
20.0.0.0
30.0.0.0
40.0.0.0
50.0.0.0
Direct Delivery
Router B
Router A
Router B
Router A
How to look at your forwarding table?
“netstat” command
Forwarding Table - 4 Host’s forwarding table is simple
– Default route (Most hosts are connected to an edge network)
Routers have more entries
– Some have > 105 entries
SNU INC lab.21
C
d
b
a
F
E
D
B
A
c
50.0.0.1
40.0.0.5
10.0.0.5
10.0.0.1
30.0.0.0
20.0.0.0
10.0.0.0
40.0.0.0
50.0.0.0
Forwarding table
at router B
Dest. Next hop
10.0.0.0
20.0.0.0
30.0.0.0
40.0.0.0
50.0.0.0
Direct Delivery
Direct Delivery
Router C
Router E
Router C
SNU SCONE lab.
Physical/Logical Network interaction
= 2A:33:5E:21:76:3A =C4:6E:1F:7A:1D:E1
20.0.0.3
c10.0.0.0 40.0.0.0B E
10.0.0.1 10.0.0.4
=88:36:6C:43:73:5A40.0.0.1 40.0.0.5
20.0.0.0
=88:36:6C:43:54:AB
= C4:6E:1F:ED:47:A1
End-to-end delivery over a logical network is realized by
- Successive hardware-level forwarding within a series of
physical networks
- Network layer forwarding at intermediate routers
a
DA SA DA SA PayloadFrom host a to router B
MAC DA = C4:6E:1F:ED:47:A1
MAC SA = C4:6E:1F:7A:1D:E1
IP DA = 40.0.0.5
IP SA = 10.0.01
Host a sends a datagram to Host c using the following path
20.0.0.5
=2A:33:5E:21:C4:6E
SNU SCONE lab.
IP Datagram Format
TTL (Time To Live)
– In hop count
– Remove bad packets
Header checksum– 1’s complement sum of all 16-bit words in the header
As an IP datagram moves around the Internet, TTL is counted
down by one at each router.
How do you update the checksum field?
Should we check error at each router?
The link speed of today’s fast routers: Tbps
Should process > 𝟏𝟎𝟔 pkts/sec
Fast path & slow path
SNU SCONE lab.
Fragmentation & Reassembly
MTU (Maximum Transfer Unit)
– Maximum IP datagram size that a physical network can
transmit
– Different physical networks have different MTUs
• Ethernet - 1500 Byte
• 802.11g – 2300 Byte, FDDI - 4500 Byte
Ethernet
Router Router
8000 Byte
S R
SNU SCONE lab.
Fragmentation & Reassembly
Fragmentation
– Partitioning of a datagram into multiple smaller fragments
– Sizes <= MTU of the next physical network
Reassembly
– Concatenation of fragments into the original datagram
– Protocol principle
SNU SCONE lab.
Fragmentation & Reassembly
Original =
2000 Byte
Fragments =
820 Byte
Fragments = 400 Byte
Information for reassembly
ID
Offset
Total length
Flag
R1 R2S R
MTU = 2000 MTU = 820 MTU = 2000
Where to perform reassembly? Router OR Destination?
Any security issues??
SNU SCONE lab.
ARP (Address Resolution protocol)
Problem
– Each host has two different addresses
– Physical address (Hardware address, MAC address)
– Logical address (Protocol address, IP address)
A
C EF
DB Assumption: Every host knows its own logical &
Physical addresses
Suppose A wants to send a packet to C
Same physical network
How to know C’s physical address?
SNU SCONE lab.
ARP – Basic
Use an ARP table that maps IP address – MAC address
Who manages the table ?
Note that IP address and MAC address bindings may
change dynamically
IP address MAC address
197.15.3.1 0A:4B:00:00:07:08
197.15.3.2 0B:4B:00:00:07:00
197.15.3.3 0A:5B:00:01:01:03
197.15.3.4 04:06:07:08:09:10
197.15.3.5 06:07:09:08:03:01
SNU SCONE lab.
ARP – Two Methods
Two types of network
– Broadcast network: LANs (Ethernet, Token ring, …)
– NBMA (Non-Broadcast Multiple Access)
• Example: ATM, X.25
Two AR approaches
– Distributed
• Each host builds the mapping table
• Collect mapping information asking to targets
– Centralized
• A specialized server maintains the table
• Usually, each host periodically reports its own mapping information
to the servers
SNU SCONE lab.
ARP - Distributed
• Suppose host A wants to resolve host C’s address
• Host A broadcasts a request packet
• How would you assure C receives the request?
Physical broadcast
• All hosts receive the request, but only C will respond. How?
• How to design the protocol?
A B C D E
Broadcast
Network
SNU SCONE lab.
ARP Packet Format
IP-Ethernet
HW Type Protocol Type
HLEN PLEN Operation
Sender HA (Octets 0-3)
Sender HA (octets 4,5) Sender IP (Octet 0,1)
Sender IP (octets 2,3) Target HA (Octet 0,1)
Target HA (Octets 2-5)
Target IP (Octets 0-3)
DA SA SIP SHA TIP THARequest
packet
DA SA SIP SHA TIP THAResponse
packet
SNU SCONE lab.
ARP Enhancements
ARP cache– Store mapping information in an ARP cache for later uses
When to remove cache entries?– After timeout
• e.g. 5 min
Improvements– Request packets are delivered to all hosts
– A host refreshes its cache if the sender is already in the cache
– The target adds the sender’s mapping in its cache
How to look at your ARP table?
“arp” command
SNU SCONE lab. 34
ARP Variations
Proxy ARP
– A server (usually a router) may act as a proxy for others’ IP
addresses
Gratuitous ARP (GARP)
Reverse ARP (RARP) & DHCP
A host may not know its IP address
– Knows its hardware address
Problem in general
– What is the IP address of a host with the given h/w address?
– RARP server
But, RARP has been evolved to RARP BOOTP
DHCP(Dynamic Host Configuration Protocol)
Static IP address & Dynamic IP
– Ease of management: Automatic configuration
– Efficient use of addresses: Assign address only when needed
SNU SCONE lab.
RARP, designed for diskless clients, is seldom used now
SNU SCONE lab. 36
DHCP To join the Internet, a host needs
– Unique IP address + subnet mask
– Forwarding table – Default router
– DNS server
DHCP
– A protocol to auto-configure hosts
– DHCP server has
• A pool of available IP addresses
• Default routers & DNS server info.
IP Addresses?
MAC addresses?
SNU INC lab. 37
DHCP Packet Format
Operation HType HLen Hops
Xid
ciaddr
yiaddr
siaddr
giaddr
chaddr (16 bytes)
sname (64 bytes)
file (128 bytes)
options
Secs Flags
Refer to:http://support.microsoft.com/kb/169289/ko
http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol