1 elen lecture 13 lan bridges routers, switches, gateways network layer -ip reading: 6.7, 8.1-8.3

28
1 ELEN Lecture 13 LAN Bridges Routers, Switches, Gateways Network layer -IP Reading: 6.7, 8.1-8.3

Post on 21-Dec-2015

254 views

Category:

Documents


1 download

TRANSCRIPT

1

ELEN Lecture 13

• LAN Bridges

• Routers, Switches, Gateways

• Network layer -IP

• Reading: 6.7, 8.1-8.3

2

Switches

• A multi-input multi-output device that transfers packets from one input to an output

• The number of ports on a switch determine the number of hosts that can be connected.

• Larger # of hosts can be interconnected by interconnecting switches

• Point-to-point links can be used to extend the geographic reach

• Adding a new host does not limit or reduce the performance of other hosts

3

Scalable Networks

• Switch– forwards packets from input port to output port– port selected based on address in packet header

• Advantages – cover large geographic area (tolerate latency)– support large numbers of hosts (scalable bandwidth)

Inputports

T3T3

STS-1

T3T3STS-1

Switch

Outputports

4

Virtual Circuit Switching

• Explicit connection setup (and tear-down) phase• Subsequence packets follow same circuit• Sometimes called connection-oriented model

0

13

2

01 3

2

0

13

25 11

4

7

Switch 3

Host B

Switch 2

Host A

Switch 1

• Analogy: phone call

• Each switch maintains a VC table

5

Datagram Switching

• No connection setup phase• Each packet forwarded independently • Sometimes called connectionless model

0

13

2

0

1 3

2

0

13

2

Switch 3Host B

Switch 2

Host A

Switch 1

Host C

Host D

Host EHost F

Host G

Host H

• Analogy: postal system

• Each switch maintains a forwarding (routing) table

6

Virtual Circuit Model

• Typically wait full RTT for connection setup before sending first data packet.

• While the connection request contains the full address for destination, each data packet contains only a small identifier, making the per-packet header overhead small.

• If a switch or a link in a connection fails, the connection is broken and a new one needs to be established.

• Connection setup provides an opportunity to reserve resources.

7

Datagram Model

• There is no round trip time delay waiting for connection setup; a host can send data as soon as it is ready.

• Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up.

• Since packets are treated independently , it is possible to route around link and node failures.

• Since every packet must carry the full address of the destination, the overhead per packet is higher than for the connection-oriented model.

8

Bridges, switches, routers, gateways• Devices used to interconnect multiple networks

• Bridge: device interconnecting two or more networks at MAC layer

• Router: device interconnecting two or more networks at the network layer

• Gateway: device interconnecting two or more networks at a higher layer

9

Bridge

S1 S2

S4

S3

S5 S6

LAN1

LAN2

A Bridged LAN

10

Bridge

Network

Physical

Network

LLC

PhysicalPhysicalPhysical

LLC

MAC MACMAC MAC

Interconnection by a Bridge

11

B1

S1 S2

B2

S3 S4 S5

Address Port Address Port

port 1 port 2 port 1 port 2

LAN1 LAN2 LAN3

Example Configuration

12

B1

S1 S2

B2

S3 S4 S5

Address Port Address Port

port 1 port 2 port 1 port 2

LAN1 LAN2 LAN3

S1 S5

S1 1 S1 1

S1 sends a frame to S5

13

B1

S1 S2

B2

S3 S4 S5

Address Port Address Port

port 1 port 2 port 1 port 2

LAN1 LAN2 LAN3

S3 S2

S1 1 S1 1S3 2 S3 1

S3 sends a frame to S2

14

B1

S1 S2

B2

S3 S4 S5

Address Port Address Port

port 1 port 2 port 1 port 2

LAN1 LAN2 LAN3

S4 S3

S1 1 S1 1S3 2 S3 1

S4 2S4 2

S4 Sends a frame to S3

15

Bridge1

S1 S2

Bridge 2

S3 S4 S5

Address Port Address Port

port 1 port 2 port 1 port 2

LAN1 LAN2 LAN3

S2 S1

S1 1 S1 1S3 2 S3 1

S4 2S4 2

S2 1

S2 sends a frame to S1

16

LAN1

LAN2

LAN3

B1 B2

B3

B4

B5

LAN4

(1)

(2)

(1)

(1)

(1)

(1)

(2)

(2)

(2)

(2)

(3)

Sample Topology

17

L A N 1

L A N 2

L A N 3

B 1 B 2

B 3

B 4

B 5

L A N 4

( 1 )

( 2 )

( 1 )

( 1 )

( 1 )

( 1 )

( 2 )

( 2 )

( 2 )

( 2 )

( 3 )

R

R

R

R

D

D

DD

Spanning Tree

18

RoutingControl

Route-1Designator

Route-2Designator

Route-mDesignator

DestinationAddress

SourceAddress

RoutingInformation

Data FCS

2 bytes 2 bytes 2 bytes 2 bytes

Frame Format for Source Routing

19

LAN2

LAN4

LAN3

LAN5

B4

B6

B3 B7LAN

1

B1

B2

S1

S2

S3

B5

LAN interconnection with source routing bridges

20

LAN1 B1

B3

B4

LAN3 B6 LAN5

LAN4

Routes followed by single-route broadcast frames

21

LAN5

B6

B7

LAN3

LAN4

B2

B3

B5

LAN1 B1 LAN2B3

B4 LAN4B5B7

LAN2B1

B4

LAN1 B2

LAN4 B5B7

LAN4 B4

B7

LAN2 B1

B3

LAN1 B2

B4

B5

LAN2

B1

B3 LAN3B2B5B6

LAN1 B1

LAN1 B2 LAN3B3B5B6

LAN3 B3

B2

B6

LAN1

LAN2

B1 LAN2B3B4

B1B4

LAN1 B2

Routes of all-routes broadcast frames

22

IP Internet

• Concatenation of Networks

• Protocol StackR2

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 3 (FDDI)

Network 4(point-to-point)

H7 R3 H8

R1

ETH FDDI

IPIP

ETH

TCP R2

FDDI PPP

IP

R3

PPP ETH

IP

H1

IP

ETH

TCP

H8

23

Service Model

• Connectionless (datagram-based)• Best-effort delivery (unreliable service)

– packets are lost– packets are delivered out of order– duplicate copies of a packet are delivered– packets can be delayed for a long time

• Datagram format

Version HLen TOS Length

Ident Flags Offset

TTL Protocol Checksum

SourceAddr

DestinationAddr

Options (variable) Pad(variable)

0 4 8 16 19 31

Data

24

Fragmentation and Reassembly

• Each network has some MTU• Strategy

– fragment when necessary (MTU < Datagram)– try to avoid fragmentation at source host– re-fragmentation is possible – fragments are self-contained datagrams– use CS-PDU (not cells) for ATM– delay reassembly until destination host– do not recover from lost fragments

25

Example

H1 R1 R2 R3 H8

ETH IP (1400) FDDI IP (1400) PPP IP (512)

PPP IP (376)

PPP IP (512)

ETH IP (512)

ETH IP (376)

ETH IP (512)

Ident = x Offset = 0

Start of header

0

Rest of header

1400 data bytes

Ident = x Offset = 0

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 512

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 1024

Start of header

0

Rest of header

376 data bytes

26

Global Addresses

• Properties– globally unique– hierarchical: network + host

• Dot Notation– 10.3.2.4– 128.96.33.81– 192.12.69.77

Network Host

7 24

0A:

Network Host

14 16

1 0B:

Network Host

21 8

1 1 0C:

27

Datagram Forwarding

• Strategy– every datagram contains destination’s address– if directly connected to destination network, then forward to host– if not directly connected to destination network, then forward to

some router– forwarding table maps network number into next hop– each host has a default router– each router maintains a forwarding table

• Example (R2) Network Number Next Hop 1 R3 2 R1 3 interface 1 4 interface 0

28

Address Translation

• Map IP addresses into physical addresses– destination host– next hop router

• Techniques– encode physical address in host part of IP address– table-based

• ARP– table of IP to physical address bindings– broadcast request if IP address not in table– target machine responds with its physical address– table entries are discarded if not refreshed