Transcript Network 1
The internetworking solution
of the Internet
Prof. Malathi Veeraraghavan
Elec. & Comp. Engg. Dept/CATT
Polytechnic University
[email protected]
What is the internetworking problem:
• how to connect different types of
networks
1
Polytechnic University
Single networks
A shared link:
often used to
create a LAN
Simplest network – one link
Endpoint
Endpoint
Endpoint
Endpoint
Endpoint
One network – same type of switches – link rates can be different
Endpoint
Endpoint
Switch
Switch
Endpoint
Endpoint
2
Polytechnic University
The Internet approach to
internetworking
An internetwork
Endpoint
Endpoint
Switch
Endpoint
•
Switch
Endpoint
IP router
Network 1
•
Switch
Switch
Network 3
Network 2
Have all endpoints speak the IP (Internet Protocol) in addition to their own
network protocols
For loss-sensitive applications: run TCP, an end-to-end transport protocol,
irrespective of whether
– both ends are within the same network
– the two ends are on different networks
•
IP routers are connectionless packet switches
3
University
– they forward IP packets from one network
to another based onPolytechnic
the destination
IP
address carried in the IP header and information stored in their routing tables
Protocol stacks in the Internet
Endpoint
Endpoint
A
A
Inter-T:TCP
IP router
routerrouter
Inter-N: IP
Inter-N: IP
T1
Switch
N1
N1
Switch
N1
T1
T2
N1
N2
Inter-T:TCP
Inter-N: IP
Switch
Switch
N2
N2
T2
N2
L1
L1
L2
L2
L3
L3
L4
L4
L5
L5
L6
L6
P1
P1
P2
P2
P3
P3
P4
P4
P5
P5
P6
P6
Network 2
Network 1
4
Polytechnic University
Today’s most common networks
in the Internet
• Ethernet within enterprises using a combination of
– shared-medium Ethernet LANs with hubs, or
– with Ethernet switches – which are connectionless
packet switches
• PDH/SONET networks in the MAN and WAN
domains
– Routers are interconnected by T1, T3, OC3 connections
that are set up through a PDH/SONET circuit-switched
network
– PPP, Point-to-Point Protocol, is executed on these
circuits
5
Polytechnic University
Ethernet frame structure
(RFC 894 and 893)
Dest. Src.
Addr Addr. Type
.
6
6
2
FOCUS:
Ethernet
addresses
(also called
MAC addresses)
are 6 bytes long
46-1500
Type
0800
46-1500
Type
0806
Type
8035
4
IP
datagram
2
2
CRC
Data
ARP req./reply
28
RARP req./reply
28
2
6
PAD
18
PAD
18
Polytechnic University
PPP frame structure
flag
addr ctrl
7E
FF
03
1
1
1
protocol
data
CRC
flag
7E
2
<= 1500
0021
IP datagram
2
1
296 if low delay
C021
link control data
8021
network control data
7
Polytechnic University
IP Datagram Format
version
(4 bits)
header
length
Type of Service/TOS
(8 bits)
>= five 32-bit words
Identification (16 bits)
TTL Time-to-Live
(8 bits)
Total Length (in bytes)
(16 bits)
flags
(3 bits)
Protocol
(8 bits)
Fragment Offset (13 bits)
Header Checksum (16 bits)
Source IP address (32 bits)
FOCUS
Destination IP address (32 bits)
Options (if any, <=40 bytes)
DATA
0
31
32-bit word
8
Polytechnic University
User-plane interworking Encapsulation
Application
User data
As data moves down the
protocol stack, each protocol
adds layer-specific control
information.
Application
Header
User data
TCP
TCP Header
IP
Application data
TCP segment
IP Header
TCP Header
Ethernet
Driver
Application data
IP datagram
Ethernet
Header
IP Header
TCP Header
Application data
Ethernet
Trailer
Ethernet frame
9
Polytechnic University
Layers used in ftp
mng.poly.edu
photon.poly.edu
FTP
program
FTP protocol
FTP
program
TCP
TCP protocol
TCP
IP
Ethernet
Driver
IP
IP protocol
Ethernet
protocol
Ethernet
Driver
IP protocol
Ethernet
Driver
Ethernet
protocol
IP
Ethernet
Driver
IP router: dibner-gw
10
Polytechnic University
Need Internet address and
Network address
Internetwork
IP router
Host A
Switch
1
Switch
2
1
Host B
2
Switch
3
Switch
4
Host D
3
Ethernet 1
Host A sends a packet to Host C:
- Places Host C’s IP address in IP header
- To get through Ethernet 1, it needs Ethernet address of IP router’s
interface 1
- Switch 1 and Switch 2 forward packets based on destination Ethernet
address of IP router’s interface 1
- IP router forwards packet to port 2 to reach Host C (based on IP level
routing data using destination IP address of host C)
- IP router needs Ethernet address of Host C to send the packet through
Ethernet 2
11
- Switch 3 and 4 forward packets based on destination Ethernet address
of Host C
Host C
Ethernet 2
Host E
Switch
Switch
Host F
Ethernet 3
Polytechnic University
Addresses for interfaces
• Both IP addresses and Ethernet addresses are assigned per
interface, not per node (router or host).
• An IP router has many interfaces; each interface has an IP
address; interfaces that connect the IP router to an Ethernet
network also have Ethernet addresses, one per interface
• An Ethernet switch has many interfaces; each has an
Ethernet address
• A host typically has only one interface; hence it is assigned
one IP address and one Ethernet address if its interface is
an Ethernet link
12
Polytechnic University
FTP session from host mng to photon
mng.poly.edu
photon.poly.edu
128.238.42.105
128.238.42.1
128.238.32.1
128.238.32.22
dibner-gw.poly.edu
Note that IP router dibner-gw has more than one IP address
13
Polytechnic University
Packet sent from mng
to IP router dibner-gw
mng.poly.edu
src IP address: 128.238.42.105
dst IP address: 128.238.32.22
src MAC address: 5:6:7:1:a1:f
dst MAC address: 0:0:c:1:a2:e
0:0:c:1:a2:e
5:6:7:1:a1:f
router
dibner-gw.poly.edu
•
•
Host mng consults its IP routing table. This says that to reach destination IP
address 128.238.32.22, it needs to send the packet to the IP router because this
destination is on a different network
Hence it sends the packet within its Ethernet network to destination Ethernet
(MAC) address 0:0:c:1:a2:e because this is the Ethernet address of the router
interface that is connected to mng’s Ethernet network. This destination MAC
address allows the Ethernet packet (called frame) to be routed through the first
Ethernet network – Ethernet switches
based on
14 determine how to route
Polytechnic
University
destination MAC address
At the IP router, dibner-gw
• When the packet arrives at the IP router, dibner-gw, it looks up its
routing table
– For destination IP address 128.238.32.22, the routing table shows which
output port to use.
dibner-gw
128.238.32.1
0:0:c:1:a2:d
photon.poly.edu
(128.238.32.22)
dibner-gw
128.238.42.1
0:0:c:1:a2:e
15
Polytechnic University
Packet sent from mng
to IP router dibner-gw
src IP address: 128.238.42.105
dst IP address: 128.238.32.22
src MAC address: 0:0:c:1:a2:d
dst MAC address: 0:0:5e:3f:4d:2c
photon.poly.edu
0:0:5e:3f:4d:2c
router
0:0:c:1:a2:d
dibner-gw.poly.edu
•
•
IP router, dibner-gw, finds MAC address of photon and adds the IP header and
Ethernet header to the packet with the four addresses as shown and sends it.
The destination MAC address allows for routing through the second Ethernet
network; each Ethernet switch that the frame encounters will forward packets
based on destination MAC address and its routing table.
16
Polytechnic University
Intra-network addresses and
inter-network addresses
• Consider example:
– mng knows that to reach photon it has to route the
packet to the IP router dibner-gw from its IP-level
routing data
– it needs to find the MAC address of the router to get
through the first Ethernet
– it does this using ARP (Address Resolution Protocol)
• Same thing when dibner-gw needs to send packet
to photon.
17
Polytechnic University
ARP
(Address Resolution Protocol)
128.238.42.1
ARP
0:0:c:1:a2:e
mng.poly.edu
ARP
all stations on the
same Ethernet
128.238.32.22
ARP
0:0:5e:3f:4d:2c
dibner-gw .poly.edu
ARP
all stations on the
same Ethernet
18
Polytechnic University
ARP and RARP
• The IP protocol uses 32-bit addresses.
• Ethernet networks use 48-bit Ethernet (MAC) addresses
• The ARP and RARP protocols perform the translation
between IP addresses and MAC layer addresses.
• We will discuss ARP for broadcast LANs, particularly
Ethernet LANs.
IP address
(32 bit)
ARP
RARP
19
Ethernet MAC
address
(48 bit)
Polytechnic University
Finding MAC address of an interface
whose IP address is available
(1) HOST-A wants to send an IP
datagram to HOST-B.
(2) HOST-A broadcasts an ARP
request to all stations on the
network: “What is the
hardware address of HOSTB?”
(3) HOST-B responds with an
ARP Reply which contains its
hardware address.
(4) HOST-A transmits the IP
datagram to HOST-B.
HOST-A HOST-B
IP
1
IP
ARP
ARP
Ethernet
Driver
Ethernet
Driver
3
2
4
20
Polytechnic University
ARP reply
• The ARP reply is sent by the node whose IP
address matches the address sent in the ARP
request
• All other nodes receiving the broadcast ARP
ignore the request (since their IP addresses
do not match the address that is being
resolved)
21
Polytechnic University
ARP cache
• Clearly, sending an ARP request/reply for
each IP datagram is inefficient.
• Each station maintains a cache (ARP
Cache) of current entries. The entries expire
after 20 minutes.
• Everytime the ARP cache is consulted for a
MAC address, the expiry timer is reset in
common implementations.) at (incomplete)
22
Polytechnic University
Whose addresses does a host
store on initialization?
• Go to Control Panel – Network on a
Windows PC
– Point out that a host needs to have initialized
• host IP address
• gateway IP address (default router interface)
• DNS server IP address
23
Polytechnic University
For Internet applications, what
type of “address” do you need?
• To begin with, a user obtains “domain
name” of a host to which the user wants to
connect for a web file download, to send
email etc.
• Host needs to find IP address corresponding
to domain name
– it does this by sending a DNS (Domain Name
Service) query to the DNS Server whose IP
address is stored on host (as we just saw)
24
Polytechnic University
For the file transfer example from
mng to photon
photon.poly.edu
ftp
program
128.238.32.22
mng.poly.edu
Domain
Name
Server
gatekeeper.poly.edu
• Step 1:
– mng knows it wants to execute an ftp to
photon.poly.edu
– sends DNS query to DNS server gatekeeper.poly.edu
– gets IP address corresponding to name photon.poly.edu
25
Polytechnic University
What other addresses does
mng need?
• With photon’s IP address, mng consults its
routing table to see how it can reach this
node.
• Show route print command on PC
– point out entry for hosts on the same subnet as
having the gateway address as the IP address of
the host interface itself
– point out default entry 255.255.255.255 as
having the address of the IP router (gateway)
26
Polytechnic University
What if photon was on same
Ethernet as mng?
• In this case, the IP address of photon would
have matched the entry in the routing table
that says photon can be reached through the
PC’s Ethernet interface
• Therefore it will try to find the Ethernet
address of photon to send the packet via its
own network
– it does this by issuing an ARP
27
Polytechnic University
What happened when photon was
on a different Ethernet from mng
• Route lookup showed that IP address (of photon)
was on some other network and hence packet had
to be sent to the default router (gateway)
• mng then needed Ethernet address of default
router. The first time this has to be learned by
sending an ARP. Then as long as it is used often
(before ARP cache expires), mng knows the
Ethernet address of its default router and does not
have to issue ARP requests each time
28
Polytechnic University
Internet transport protocols
• Loss-sensitive applications: TCP
– End-to-end – across networks
– To ensure error-free delivery, it executes ARQ retranmission
scheme for error correction
– Uses window based flow control
– Because IP routers are CL packet switches that do not
implement congestion control, TCP implements an end-toend congestion control
• Delay-sensitive applications: RTP (Real-time Transfer
Protocol)
– All packets carry a timestamp allowing receiver to determine
when to play out packets
29
Polytechnic University
Summary
• The Internet is an internetwork of networks
• Any type of network, CS, CL PS, CO PS can be
part of the Internet
• “IP router” is the node that interconnects different
networks
– CL packet switch
• Need Internet addresses (i.e., IP addresses) and
addresses for each network that packets traverse
• Internetwork transport protocols: TCP and RTP
30
Polytechnic University