Вы находитесь на странице: 1из 29

UNIT-III

Router Architecture Overview


Two key router functions:
• Run routing algorithms/protocol (RIP, OSPF, BGP)
• Forwarding datagrams from incoming to outgoing link
Four components of a router
• Input ports. The input port performs several functions.
– It performs the physical layer functionality of terminating an incoming
physical link to a router.
– It performs the data link layer functionality needed to interoperate
with the data link layer functionality on the other side of the incoming
link.
– It also performs a lookup and forwarding function so that a datagram
forwarded into the switching fabric of the router emerges at the
appropriate output port.
– Control packets (e.g., packets carrying routing protocol information
such as RIP, OSPF or IGMP) are forwarded from the input port to the
routing processor.
– In practice, multiple ports are often gathered together on a single line
card within a router.
Four components of a router
• Switching fabric. The switching fabric connects the router's input ports to
its output ports. This switching fabric is completely contained with the router
- a network inside of a network router!

• Output ports. An output port stores the datagram's that have been forwarded
to it through the switching fabric, and then transmits the datagram's on the
outgoing link. The output port thus performs the reverse data link and
physical layer functionality as the input port.

• Routing processor. The routing processor executes the routing protocols


maintains the routing tables, and performs network management functions
within the router.
Input Port Functions

Physical layer:
bit-level reception
Data link layer: Decentralized switching:
e.g., Ethernet • Given datagram destination, lookup output
(see chapter 5) port using forwarding table in input port
memory
• Goal: complete input port processing at ‘line
speed’
• Queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Switching Fabric
• Many modern routers
also switch via
memory. A major
difference from early
routers, however, is that
the lookup of the
destination address and
the storing (switching) of
the packet into the
appropriate memory
location is performed by
processors on the input
line cards.
Output Ports

• Buffering required when datagrams arrive from fabric


faster than the transmission rate
• Scheduling discipline chooses among queued datagrams
for transmission
(More on queueing next slides…)
Output Port Queueing

• Buffering when arrival rate via switch exceeds output line speed
• Queueing (delay) and loss due to output port buffer overflow!
Input Port Queuing

• Fabric slower than input ports combined  queueing may


occur at input queues
• Head-of-the-Line (HOL) blocking: queued datagram at front of
queue prevents others in queue from moving forward
• Queueing delay and loss due to input buffer overflow!
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address from network
server when it joins network
– Can renew its lease on address in use
– Allows reuse of addresses (only hold address while connected/”on”)
– Support for mobile users who want to join network (more shortly)
• DHCP overview:
– Host broadcasts “DHCP discover” msg [optional]
– DHCP server responds with “DHCP offer” msg [optional]
– Host requests IP address: “DHCP request” msg
– DHCP server sends address: “DHCP ack” msg
DHCP Client-Server Scenario

A DHCP 223.1.2.1
223.1.1.1
server
223.1.1.2
223.1.1.4 223.1.2.9
B
223.1.2.2 arriving DHCP
223.1.1.3 223.1.3.27 E client needs
address in this
223.1.3.1 223.1.3.2
network
DHCP client-server scenario
DHCP server: 223.1.2.5 arriving
DHCP discover
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs

Network Layer
DHCP: more than IP address
DHCP can return more than just allocated IP
address on subnet:
– address of first-hop router for client
– name and IP address of DNS sever
– network mask (indicating network versus host
portion of address)
DHCP: Example
DHCP DHCP • Connecting laptop needs its IP
DHCP UDP address, addr of first-hop
DHCP IP
router, addr of DNS server 
DHCP Eth
Phy use DHCP
DHCP
• DHCP request encapsulated in UDP,
encapsulated in IP, encapsulated in
802.1 Ethernet
DHCP DHCP
168.1.1.1
DHCP UDP
DHCP IP • Ethernet frame broadcast (dest:
DHCP Eth router FFFFFFFFFFFF) on LAN, received at
Phy
(runs DHCP) router running DHCP server

• Ethernet demux’ed to IP
demux’ed, UDP demux’ed to DHCP
DHCP: Example
DHCP DHCP • DCP server formulates DHCP
DHCP UDP ACK containing client’s IP
DHCP IP address, IP address of first-hop
DHCP Eth router for client, name & IP
Phy address of DNS server

• Encapsulation of DHCP server,


DHCP DHCP frame forwarded to client,
DHCP UDP demux’ing up to DHCP at
DHCP IP client
DHCP Eth router • Client now knows its IP
DHCP
Phy
(runs DHCP) address, name and IP address
of DSN server, IP address of its
first-hop router
IP Addressing: the Last Word...

Q: How does an ISP get block of addresses?


A: ICANN: Internet Corporation for Assigned
Names and Numbers
– allocates addresses
– manages DNS
– assigns domain names, resolves disputes
NAT: Network Address Translation

rest of local network


Internet (e.g., home network)
10.0.0.1
10.0.0/24
10.0.0.4
10.0.0.2
138.76.29.7

10.0.0.3

All datagrams leaving local Datagrams with source or


network have same single source NAT IP destination in this network
address: 138.76.29.7, have 10.0.0/24 address for
different source port numbers source, destination (as usual)
NAT: Network Address Translation

• Motivation: local network uses just one IP


address as far as outside world is concerned:
– Range of addresses not needed from ISP: just one IP
address for all devices
– Can change addresses of devices in local network without
notifying outside world
– Can change ISP without changing addresses of devices in
local network
– Devices inside local net not explicitly addressable, visible
by outside world (a security plus)
NAT: Network Address Translation
• Implementation: NAT router must:

– outgoing datagrams: replace (source IP address, port #) of every


outgoing datagram to (NAT IP address, new port #)
• (remote clients/servers will respond using (NAT IP address, new
port #) as destination addr)
– remember (in NAT translation table) every (source IP address,
port #) to (NAT IP address, new port #) translation pair
– incoming datagrams: replace (NAT IP address, new port #) in
dest fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
NAT: Network Address Translation
NAT translation table
2: NAT router 1: host 10.0.0.1
WAN side addr LAN side addr
changes datagram sends datagram to
138.76.29.7, 5001 10.0.0.1, 3345 128.119.40.186, 80
source addr from
…… ……
10.0.0.1, 3345 to
138.76.29.7, 5001, S: 10.0.0.1, 3345
updates table D: 128.119.40.186, 80
10.0.0.1
1
S: 138.76.29.7, 5001
2 D: 128.119.40.186, 80 10.0.0.4
10.0.0.2

138.76.29.7 S: 128.119.40.186, 80
D: 10.0.0.1, 3345 4
S: 128.119.40.186, 80
D: 138.76.29.7, 5001 3 10.0.0.3
4: NAT router
3: Reply arrives changes datagram
dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345
NAT: Network Address Translation

• 16-bit port-number field:


– ~60,000 simultaneous connections with a single
LAN-side address!
• NAT is controversial:
– Routers should only process up to layer 3
– Violates “end-to-end” argument (complexity in ends)
• NAT possibility must be taken into account by app
designers, e.g., P2P applications
– Address shortage should instead be solved by IPv6
NAT Traversal Problem
• Client wants to connect to server
with address 10.0.0.1
– Server address 10.0.0.1 local to LAN 10.0.0.1
(client can’t use it as destination Client
addr) ?
– Only one externally visible NATted 10.0.0.4
address: 138.76.29.7
• Solution 1: statically configure 138.76.29.7 NAT
NAT to forward incoming router
connection requests at given port
to server
– e.g. (123.76.29.7, port 2500) always
forwarded to 10.0.0.1 port 25000
– But must be done ahead of time!
NAT Traversal Problem
• Solution 2: Universal Plug and Play
(UPnP) Internet Gateway Device
10.0.0.1
(IGD) Protocol. Allows NATted hostClient
to: ? IGD
• Learn public IP address 10.0.0.4
(138.76.29.7)
138.76.29.7 NAT
• Add/remove port mappings router
(with lease times)
i.e. automate static NAT port
map configuration
– Still ahead of time, but automatic
NAT Traversal Problem
• Solution 3: relaying (used in Skype)
1. NATed client establishes connection to relay
2. External client connects to relay
3. Relay bridges packets between to connections

2. connection to
relay initiated 1. connection to
by client relay initiated
10.0.0.1
by NATted host
3. relaying
Client
established
138.76.29.7 NAT
router
ICMP: Internet Control Message Protocol

• Used by hosts & routers to


Type Code description
communicate network-level 0 0 echo reply (ping)
information 3 0 dest. network unreachable
– error reporting: unreachable 3 1 dest host unreachable
host, network, port, protocol 3 2 dest protocol unreachable
– echo request/reply (used by 3 3 dest port unreachable
ping) 3 6 dest network unknown
3 7 dest host unknown
• Network-layer “above” IP:
4 0 source quench (congestion
– ICMP msgs carried in IP control - not used)
datagrams 8 0 echo request (ping)
• ICMP message: type, code plus first 8 9 0 route advertisement
bytes of IP datagram causing error 10 0 router discovery
11 0 TTL expired
12 0 bad IP header
Traceroute and ICMP
• Source sends series of • When ICMP message
UDP segments to dest arrives, source calculates
– First has TTL =1 RTT
– Second has TTL=2, etc. • Traceroute does this 3
– Unlikely port number times for each router
• When nth datagram Stopping criterion
arrives to nth router: • UDP segment eventually arrives
at destination host
– Router discards datagram
• Destination returns ICMP “host
– And sends to source ICMP unreachable” packet (type 3,
message (type 11, code 0) code 3)
– Message includes name of • When source gets this ICMP,
router & IP address stops
IPv6
• Initial motivation: 32-bit address space soon
to be completely allocated.
• Additional motivation:
– header format helps speed processing/forwarding
– header changes to facilitate QoS
• IPv6 datagram format:
– fixed-length 40 byte header
– no fragmentation allowed
IPv6 Header
Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same “flow”
(concept of “flow” not well defined).
Next header: identify upper layer protocol for data
Other Changes from IPv4
• Checksum: removed entirely to reduce
processing time at each hop
• Options: allowed, but outside of header,
indicated by “Next Header” field
• ICMPv6: new version of ICMP
– additional message types, e.g. “Packet Too Big”
– multicast group management functions
• To help transition  Tunneling: IPv6 carried
as payload in IPv4 datagram among IPv4
routers

Вам также может понравиться