18
LAN SWITCHING V 2.1 30th/April/2020 All rights reserved ©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos

LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

LAN SWITCHINGV 2.1 30th/April/2020

All rights reserved ©2017-2020 From textbook “Conceptual Computer Networks“ byJosé María Foces Morán & José María Foces Vivancos

Page 2: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Ethernet Frame2

Destination Address

SourceAddress Payload CRC32

Ethernet frame

Header

ErrorControl

Ethertype

48-bit MAC address

16-bit Multiplexing

Key

Variable-length48-bit MAC address

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 3: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Ethernet Frame3

¨ MAC Addresses¤ Unicast: Represents a single

station¤ Broadcast: All stations in LAN

All 1’s address: 0xffffffffffff¤ Multicast: A subset of stations

Destination Address

SourceAddress Payload CRC32

ErrorControl

Ethertype

48-bit MAC address

16-bit Multiplexing

Key

Variable-length48-bit MAC address

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 4: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

¨ Each NIC:¤ NIC has a MAC address of its own¤ Sends frames¤ Receives frames

¨ Frames accepted by a NIC¤ If promiscuous mode is SET

n All frames

¤ If promiscuous mode is NOT SETn Only frames which Dest MAC is == NIC’s MAC

¤ All frames sent to broadcast

NIC: Network Interface Card4

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 5: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Limitations of Ethernet

Multiple Ethernet segments can be joined together by using repeaters.¨ A repeater is a device that regenerates digital signals.

¤ No more than four repeaters¤ 2500m max¤ Limited total number of stations (Computers)

¨ Broadcast media: A sent frame is received by all the stations, necessarily¨ Half duplex: Only one frame can be being transmitted at any one time¨ HUB = Multiport repeater

5

RepeaterRepeaterRepeaterRepeater

2500 m maxRtt = 51,2 µs

500 m max

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 6: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Ethernet 12500 m max!

Ethernet 22500 m max!

What network device can communicate E1 with E2without

violating the max distance limitation of Ethernet???

??

Communicating two max Ethernets6

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 7: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Connecting two max Ethernets7

Ethernet 12500 m max!

Ethernet 22500 m max!?

¨ A) Repeater in between them?¤ It might exceed the physical limitation of the Ethernet

¨ B) Hubs? Hub simply regenerate electrical signals¤ Same limitations as repeaters.

¤ Hubs are Physical-layer devices

¨ C) Bridge? Networking equipment that forwards frames between segments¤ Bridges/switches are Datalink-layer devices

?

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 8: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Connecting two max Ethernets8

Bridge service (Software) communicatesEthernets as though they were one!

doCopy(receivedFrame, destinationPort);

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Ethernet 12500 m max!

Ethernet 22500 m max!

enp1s0 enp2s0

!

NICNIC

Page 9: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Connecting two Ethernets: Bridge

9

!

Ethernet 12500 m max!

Ethernet 22500 m max!

2-port Ethernet bridge!

· Electrically separates Ethernets· At least, 2 ports: ·· NIC on port 1 ·· NIC on port 2· Store/Forward device = S/F· Bridge service (Software) communicates Ethernets as though they were one! doCopy(receivedFrame, destinationPort);

P2P1

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 10: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

¨ The no-frills bridge (simplest, oldest, not used today)¤ Each frame received on a port is forwarded to all its

other ports

¤ Not used today

¨ Learning Bridge¤ Learn MAC addresses as nodes send traffic

¤ Have a Station cache or Forwarding Tablen It contains a MAC – Port table

n Station sends a frame onto the network for the first time

n Switch records its source MAC and the port number it was received onto

Bridges10

Ethernet 1 Ethernet 2Bridge

doCopy(receivedFrame, destinationPort);

P2P1

A B C D E F

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 11: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

1. Receive a frame on a port and store it into the incoming frame buffer

2. Consult forwarding table1. Record the source MAC address into de forwarding table

2. If destination MAC belongs to the another port, send it onto that port when possible

3. If destination MAC belongs to receiving port, do nothing

4. If destination MAC has not been recorded into the forwarding table yet, flood the frame (Send it onto all ports except the one it was received onto)

Bridge algorithm11

Ethernet 1 Ethernet 2Bridge

doCopy(receivedFrame, destinationPort);

P2P1

A B C D E F

Destination Address

SourceAddress Payload CRC32

ErrorControl

Ethertype

48-bit MAC address

16-bit Multiplexing

Key

Variable-length48-bit MAC address

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 12: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

¤ Learning on which port each host resides?

¤ Download a table into the bridge J NO! (Too much maintenance)

¤ Record new source MAC A into the Forwarding Table when host A sends its first frame

Forwarding tableHostMAC Port-----------A P1B P1C P1D P2E P2F P2

Learning and forwarding examples12

Ethernet 1 Ethernet 2Bridge

doCopy(receivedFrame, destinationPort);

P2P1

A B C D E F

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 13: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

¨ Can the bridge learn this information by itself?¤ Yes: this is the learning bridge

¨ Here’s how:¤ A bridge inspects the source MAC address in every Ethernet frame it receives

¤ Record that information into the forwarding table (FT)

¤ When a bridge first boots, this table is empty

¤ Entries are added over time as hosts inject frames into their portsn A timeout is associated with each entry (aging)

n The bridge discards the entry after a specified period of time

n It server to protect against the situation in which a host is moved from one network to another

¤ If the bridge receives a frame that is addressed to a host not currently in the tablen Send the frame onto all other ports (Not on the one it was received on): flooding

ForwardingTable

HostMAC Port--------A P1B P1C P1D P2E P2F P2

Learning and forwarding examples

13

Ethernet 1 Ethernet 2Bridge

doCopy(receivedFrame, destinationPort);

P2P1

A B C D E F

Destination Address

SourceAddress Payload CRC32

ErrorControl

Ethertype

48-bit MAC address

16-bit Multiplexing

Key

Variable-length48-bit MAC address

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 14: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Extended LAN domains

¨ Can A collide with B? Yes, it can since A and B are connected to the same Ethernet segment

¨ Can A collide with X? No, since A and X belong to different Ethernet segments

¨ There exist TWO segments or collision domains¤ A, B, C and bridge port P1¤ D, E, F and bridge port P2

¨ HOWEVER, there is only one Extended LAN (Network)¤ When a broadcast frame is sent, it is received by all network hosts, we say that it contains a

single BROADCAST DOMAIN

14

Ethernet 1 Ethernet 2Bridge

doCopy(receivedFrame, destinationPort);

P2P1

A B C D E F

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 15: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Ethernet vs. Switched Ethernet

Switch StationBroadcast frame

Incomingbroadcast frame Send onto

all other ports

FloodingSwitch

¨ Shared Ethernet:¤ Inherently BROADCAST¤ Every frame is delivered to all hosts, inevitably¤ Half-duplex¤ Only one flow active at a time

n Bus topology and Star topology (hub)

¨ Switched Ethernet:¤ An Extended LAN based on the interconnection of

LAN segments by using bridges and switches¤ BROADCAST is possible but not inherent to the

technology, how?¤ Full-duplex¤ Several simultaneous communication paths (Flows)

activen Star topology, only

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

15

Page 16: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Switches do support broadcast

¨ As usual, a frame can be addressed to the broadcastaddress

¨ The switch will forward a broadcast frame to all ports¤ Except the port it was received onto

¤ Known as Flooding

Switch StationBroadcast frame

Incomingbroadcast frame Send onto

all other ports

FloodingSwitch

16

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 17: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

Devices and Network Architecture17

SubnetworkIP

TCP

Application

End host

UDP

IP

LAN switch

IP router

HUB 100BASE-T

Physical

PhysicalDatalink

PhysicalDatalink

Subnetwork

Subnetwork

Internet Architecture

OSI Architecture

HUB

Network

©2017-2020 From textbook “Conceptual Computer Networks“ by José María Foces Morán & José María Foces Vivancos. All rigths reserved.

Page 18: LAN SWITCHING - paloalto.unileon.espaloalto.unileon.es/cn/lect/CN-LAN-Switching.pdf · Limitations of Ethernet Multiple Ethernet segmentscan be joined together by using repeaters

The end

©2013, José María Foces Morán, lecturer

18