cs 453 computer networks lecture 21 layer 3 network layer network layer of the internet

16
CS 453 CS 453 Computer Networks Computer Networks Lecture 21 Lecture 21 Layer 3 Network Layer Layer 3 Network Layer Network Layer of the Network Layer of the Internet Internet

Upload: maria-todd

Post on 12-Jan-2016

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

CS 453CS 453Computer NetworksComputer Networks

Lecture 21Lecture 21

Layer 3 Network LayerLayer 3 Network Layer

Network Layer of the InternetNetwork Layer of the Internet

Page 2: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT Remember that IP addresses should be

unique – Globally, Universally There are not really enough IP addresses to

go around Many situations where you have a single

“legitimate” IP address So, how do you expand your local area

network with that single address Network Address Translation - NAT

Page 3: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT Common scenario— You buy a cheap ethernet switch/router from Nerd-R-

Us to install at home Your connect it to your Cable modem Your router acts like a single DHCP client – gets a

single IP address from the ISP So, you hook up your mother-in-law’s computer,

Uncle Fred’s computer, and you throw a Cat5 cable out the window to your neighbor and connect his computer to your router

Ok, but…

Page 4: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT Common scenario— … you can’t all use the same ISP assigned IP

address… How would packets know which host they are

going to, coming from Network Address Translation

Page 5: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT There are three special IP address ranges

Non-routable

Non-unique These are

10.x.x.x

192.168.x.x

??? So the “backside” of the router issues DHCP

addresses too,… …but these addresses are from the non-routable

families

Page 6: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT Recall that the IP packet header contains the

IP address of the host, . … but also the socket that the transport layer

is using From the outside all hosts in our little LAN

look like they have the same IP address

Page 7: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT The router creates a table… The router assigns each internal host a port number,

along with the The table maps the external IP+port to the internal IP in

the local LAN

External IP/Port Internal IP

157.182.99.99/5050 10.0.0.15

157.182.99.99/5051 10.0.0.16

…. ….

Page 8: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT

From: Tanenbaum, 2003, 446

Page 9: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

IP Network Address Translation NAT

NAT NAT really irks a lot in the IP community Violates the IP unique address rule IP is connectionless, NAT creates a

connectionMust track state

Violates protocol layer conventionDips into IP header (port address)

Breaks on some protocols (payload imbedded addresses

Might not be able to scale to large subnet

Page 10: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

ICMP

Internet Control Message Protocol In addition to all the user, host to host

message traffic using IP protocol in the network…

Routers, switches and other devices need to talk to each other

…to keep the network running They have their own protocol for doing this

ICMP

Page 11: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

ICMP

Message Meaning

Destination Unreachable Packet could not be delivered

Time Exceeded Timer/counter hit 0

Parameter Problem Invalid header info

Source quench Source swamping network

Redirect Suggests new routing

Echo Asks a destination to reply

Echo reply Reply from echo request

Timestamp request Asks for a reply with a timestamp

Timestamp reply Reply from a timestamp request

Page 12: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

Finding Etherland

At Layer 3 we are dealing with, routing by, etc. IP and IP addressesBut within a LAN we are using the local Layer 2/1 technology…for example, ethernetWithin an Ethernet LAN, it sends, receives, routes ethernet frames, not IP packetsSo, when a packet containing an IP address hits an ethernet LAN,…How does it know where to go?

Page 13: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

ARP-Address Resolution Protocol

Once on the LAN the frames address destination address must be set to the MAC address of the destination host interface

To do this---

Page 14: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

ARP-Address Resolution Protocol

The sending machine Reads the IP address from the message Transmits an ARP request – “Who does this

belong to” The IP address owner replies “Me” by

returning its MAC address The sender assigns the received MAC to the

destination field in the frame header… …and send the frame on its way

Page 15: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet

RARP

Reverse Address Resolution Protocol What happens when you know the MAC

address but you need to know the IP address?

Page 16: CS 453 Computer Networks Lecture 21 Layer 3 Network Layer Network Layer of the Internet