network layer functions

27
Network Layer Functions • Key Layer in Internet Architecture • End-to-end Packets • Adapt to lower layers 1 1 2 2 3

Upload: jania

Post on 05-Jan-2016

24 views

Category:

Documents


0 download

DESCRIPTION

Network Layer Functions. Key Layer in Internet Architecture End-to-end Packets Adapt to lower layers. 3. 2. 2. 1. 1. Network Layer. Design Goals ‘Independent’ of layer 1 & 2 implementations Hide layer 1 & 2 details from upper layers Architecture Connection oriented Connectionless - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Network Layer Functions

Network Layer Functions

• Key Layer in Internet Architecture

• End-to-end Packets

• Adapt to lower layers

1 12 2

3

Page 2: Network Layer Functions

Network Layer

• Design Goals– ‘Independent’ of layer 1 & 2 implementations– Hide layer 1 & 2 details from upper layers

• Architecture– Connection oriented– Connectionless– (where should reliability be done?)

• Services– Routing (Path selection)– Adaptation to different lower layers

Page 3: Network Layer Functions

Routing Algorithms• Goals

– Optimality– Fairness– Stablility– Robustness– Correctness– Simplicity

• Adaptive vs Static

• Congestion Control

Page 4: Network Layer Functions

Adaptive Routing

• Centralized

• Isolated

• Distributed

Page 5: Network Layer Functions

Distributed Routing• Metric - Vector Algorithms

– sometimes called shortest path– Bellman-Ford most famous– Knowledge of immediate neighbors– Result is “first step” in path to ultimate

destination

• Link State Algorithms– OSPF {Open Shortest Path First}– Knowledge of network layer map

(connectivity)

Page 6: Network Layer Functions

Congestion Control

RESEARCH ISSUE!

• Resource Reservation

• Packet Discarding

• Flow Control

Page 7: Network Layer Functions

Routing Information Protocol (RIP)

• Known as a routing table update protocol

• Developed by Xerox and gained widespread acceptance by the proliferation of TCP/IP’s implementation of it in UNIX.

• Other protocols (AppleTalk, NetWare) adopted RIP as their standard routing update protocol.

• Known as a distance vector protocol.

–Vector is an adjacent router and the distance is how far away (hops) the network is.

–One hop is considered one router traversed.

• Devised for relatively stable, small-to-medium size networks (less than 16 routers in diameter) .

Page 8: Network Layer Functions

Calculating the Cost

Network 1

Network 2

Network 3

Network 4

Network Hops

2 1

3 1

1 2

Network Hops

1

1

1

2

Network Hops

1

1

2

3

3

4

2

1

3 2

Transmittedroutingtable

Transmittedroutingtable

Internal routingtable

Router A

Router B

Router C

Page 9: Network Layer Functions

IP Routing

• Making Decisions

• Gathering Information

• ICMP

Page 10: Network Layer Functions

Routing Table

Network Mask Router Hops Age Port ID 3 255 C 1 30 1 4 255 C 1 30 2 2 255 B 2 15 2 1 255 B 3 45 2

Page 11: Network Layer Functions

Example: TCP/IP

• Not the only way to do things ...

• But well tested in the field

• Brief History

• TCP/IP vs ISO protocols

Page 12: Network Layer Functions

References TCP/IP• Overall -- Douglas Comer

– Internetworking with TCP/IP, Vol I, 3d ed.– Internetworking with TCP/IP, Vol II– Internetworking with TCP/IP, Vol III (Sockets)– Internetworking with TCP/IP, Vol III (TLI)

• Unix Programming -- W. Richard Stevens– Unix Network Programming– Advanced Unix Network Programming

• Stevens & Wright– TCP/IP Illustrated Vol I– TCP/IP Illustrated Vol II– TCP/IP Illustrated Vol III

Page 13: Network Layer Functions

TCP/IP Stack

1

2

3

4

5 -7

OSI

DIX Ethernet or ...

ARP

ICMPIP

TCP UDP

DNSTELNET

FTP

Page 14: Network Layer Functions

Notes on TCP/IP Suite

• TCP/IP preceded the OSI Reference Model

• Layers 1 & 2 are not part of the standard

• Functions above the Transport Layer are consolidated

Page 15: Network Layer Functions

Brief Definitions

• ARP -- Address Resolution Protocol

• IP -- Internet Protocol

• ICMP -- Internet Control Message Protocol

• UDP -- User Datagram Protocol

• TCP -- Transmission Control Protocol

• DNS -- Domain Name System

• FTP -- File Transfer Protocol

• TELNET -- remote terminal

Page 16: Network Layer Functions

Other TCP/IP Protocols

• Routing Protocols -- RIP, OSPF, EGP, GGP• BOOTP - Bootstrap Protocol• RARP - Reverse ARP• TFTP - Trivial FTP• HTTP - Hyper Text Transfer Protocol• SMTP - Simple Mail Transfer Protocol• SNMP - Simple Network Management Protocol

Page 17: Network Layer Functions

Layer ProtocolsDNSQuery DNS

Reply

SYN

SYN/ACK

ACKCaller Callee

{TCP Establishment}

ARPRequest ARP

Reply

Page 18: Network Layer Functions

IP Functionality

• Presents single, virtual network to user

• Connectionless Delivery

• Packet Routing

• Interface to Lower Layers

Page 19: Network Layer Functions

IP Addresses• “Dotted Decimal”

32 bit (4 byte) address, written by taking each byte as an unsigned number

• Address Classes [first octet]

– A - <net> < > <host> < > 1-126– B - <net> < > <host> < > 128-191– C -< > <net> < > <host> 192-223– D - special subset of C 224-239 multicast– E - reserved 240-254

• Netmask – a 32 bit value which, when ANDed with an address, selects only the

network part

Page 20: Network Layer Functions

Netmask Usage“Do a bitwise AND then compare for

equality of results”

<src addr> & netmask =?= <dst addr> & netmask

if comparison is equal, then both src & dst are on same (sub)net.

Same netmask

Page 21: Network Layer Functions

Netmask ExamplesS= 128.194.100.10M= 255.255.255.0result 128.194.100.0

D= 128.194.200.10M= 255.255.255.0result 128.194.200.0

Not Equal

S= 128.194.12.10M= 255.255.255.0result 128.194.12.0

S= 67.194.18.10M= 255.255.240.0result 67.194.16.0

D= 128.194.12.110M= 255.255.255.0result 128.194.12.0

D= 67.194.10.10M= 255.255.240.0result 67.194. 0.0

?

?

Page 22: Network Layer Functions

Special Address Conventions

• This host

• Host on this net

• Limited broadcast

• Directed broadcast

• Loopback

all 0’s

127 anything (usually 1)

net

hostall 0’s

all 1’s

all 1’s

Page 23: Network Layer Functions

IP Header0 16 31

VERS HLEN SERVICE TYPE TOTAL LENGTH

FLAGS FRAGMENT OFFSETIDENTIFICATION

TIME TO LIVE PROTOCOL HEADER CHECKSUM

SOURCE IP ADDRESS

DESTINATION IP ADDRESS

1984

IP OPTIONS (IF ANY) PADDING

DATA

...

24

Page 24: Network Layer Functions

IP Packet Handling (rcv)

receiving

Transport Layer (TCP or UDP)

Sockets

IP

Link {DIX Type or 802.3 DSAP}

Other

Physical

Page 25: Network Layer Functions

IP Packet Handling (xmit)

sending Local or Non-Local ?

ARP

Search RoutingTable

Found! Missing!

ICMP Error

Send locally...

Page 26: Network Layer Functions

A

Bridges or Routers

B C

D

1

2

3

4

5

Address & Netmask1: 131.122.24.12 255.255.255.02: 131.122.31.253 255.255.255.03: 131.121.18.12 255.255.240.04: 131.121.24.18 255.255.240.05: 131.121.31.254 255.255.240.0

Page 27: Network Layer Functions

ICMP• ping

– ECHO Request/Reply

• traceroutetraceroute to falcon.ece.utexas.edu (128.83.196.10),

30 hops max, 40 byte packets

1 exit_133 (128.194.133.254) 2 ms 2 ms 2 ms

2 exit_128 (128.194.128.254) 2 ms 3 ms 2 ms

3 FDDI-T3.TAMU.EDU (128.194.1.13) 3 ms 3 ms 3 ms

4 FDDI-WAN.TAMU.EDU (165.91.128.17) 5 ms 4 ms 6 ms

5 sprint-gw-h1-0.the.net (129.117.16.161) 20 ms 5 ms 5 ms

6 ut8-h1-0.the.net (129.117.16.241) 8 ms 9 ms 21 ms

7 129.117.20.12 (129.117.20.12) 7 ms 11 ms 7 ms

8 ens.gw.utexas.edu (128.83.7.132) 16 ms 23 ms 21 ms

9 ece-e0.gw.utexas.edu (128.83.249.251) 12 ms 9 ms 9 ms

10 * * *