Part3 Local Area Networks (LAN)
LAN Characteristics Small geographical area Relatively high data rate Single management Topologies Bus, star, ring Specifications at physical and data link layer mostly We have already seen most of the issues, so we will start by studying LAN by example - Ethernet
Ethernet Developed in early/mid 70 s in Xerox PARC by Metcalfe and Boggs DIX standard Digital/Intel/ Xerox standardized 10 Mbps Ethernet in early 80 s (final one also called Ethernet-II) Specifies physical layer details and CSMA/CD MAC details IEEE 802 body standardized various physical layer/mac combinations, and a single Logical Link Control (LLC) on top of them, 1985 IEEE 802.2 : LLC IEEE 802.3 : CSMA/CD IEEE 802.4 : Token ring others
Specifications at data link and physical layers Network Data Link Physical LLC MAC DIX specifies only MAC sublayer and physical layer IEEE 802.2 + one of IEEE 802.3/802.4 etc. specifies complete data link and physical layer
IEEE 802.3 Multiple types within this depending on speed, media type etc. 10Base5 : 10 Mbps, thickwire coaxial cable 10Base2 : 10Mbps, thinwire coax or cheapernet 10BaseT : 10Mbps, twisted pair 10BaseF : 10Mbps, optical fiber 100BaseTX : 100Mbps, twistd pair 100BaseFX : 100 Mbps, optical fiber 1000BaseLX : 1 Gbps, optical fiber 1000BaseT : 1 Gbps, UTP All the above share the same basic frame format, difference is mostly in CSMA/CD parameters and physical layer details like encodings, media, connector etc. There are other types not covered here Default half-duplex though many types have option for full duplex (does not use CSMA/CD)
Relation Between the Standards Standards now are from IEEE (original DIX standard was only for 10 Mbps) Ethernet LAN and IEEE 802.3 LAN used interchangeably Frame format for both standards the same except for small difference TCP/IP implementations use original Ethernet frame format, no LLC (network layer directly uses Ethernet frames) Other protocols use IEEE 802.3 directly or through LLC Both types can coexist on the same LAN (will discuss how later)
Ethernet Frame Format 7 1 6 6 2 46-1500 4 PA SFD DA SA LEN LLC PDU PAD FCS IEEE 802.3 8 6 6 2 46-1500 4 PA DA SA Type DATA PAD FCS Ethernet PA: Preamble --- 10101010s for synchronization SFD: Start of frame delimiter --- 10101011 to start frame DA: Destination MAC address SA: Source MAC address LEN: Length --- number of data bytes Type: Identify the higher-level protocol LLC PDU + Pad: minimum 46 bytes, maximum 1500 FCS: Frame Check Sequence --- CRC-32
MAC Address 24 bits 24 bits Vendor Code Serial Number 0000.0c12.3456 NIC ff.ff.ff.ff.ff.ff : Broadcast address There are also multicast addresses
MAC Address (contd.) The MAC sublayer defines a hardware address which is unique for each LAN interface (NIC) The address is a 48-bit address, expressed as 12 hex digits. Hierarchical address ensures uniqueness.
Minimum Frame Size A frame must take more than 2τ time to send (τ = max. one-way propagation delay) Ethernet slot time is 51.2μsec (for 10Mbps) corresponding to 512 bit = 64 bytes Minimum frame length is 64 bytes (excluding preamble) Data field must have 46 bytes minimum An example scenario: Two machines A and B located at the far ends of the cable A starts sending a frame at time 0 Frame almost at B at time τ-δ B starts sending a frame at time τ-δ Collision occurs at time τ Jam signal gets back to A at time 2τ
Interoperation Between Ethernet and 802.3 All protocols type values standardized have values greater than 1536 Max. length field value in 802.3 frame = 1500 If length/type field value 1500, it is a 802.3 frame, else it is a Ethernet-2 frame It is also possible to carry protocols using type field inside a 802.3 field (SNAP headers) Not discussed in this course
Some Terminologies Segment Part of medium without any repeater One or more stations can connect to a segment Segments can be connected using repeaters Collision domain Set of machines such that two machines transmission can cause collision One or more segments
10BaseT 10 Mbps, Baseband, Unshielded Twisted Pair (two pairs), Cat 3 or better Logical topology bus, physical topology star using hub Hub = multiport repeater, simulates shared bus Max. distance from station to hub (max. segment length) = 100 m No. of machines/segment = 1 Collision domain all machines connected to a hub Manchester encoding 1-persistent CSMA/CD for transmission Base wait period (Ethernet Slot Time) of 51.2 μsec, binary exponential backoff for retransmission Interframe gap of 9.6 μsec
100BaseTX 100 Mbps, Baseband, Unshielded Twisted Pair (two pairs), Cat 5 or better, or Type 1 STP Logical topology bus, physical topology star using hub Max. distance from station to hub (max. segment length) = 100 m No. of machines/segment = 1 Collision domain all machines connected to a hub 4B/5B encoding 1-persistent CSMA/CD for transmission Base wait period of 5.12 μsec, binary exponential backoff for retransmission Interframe gap of 0.96 μsec
1000BaseLX 1 Gbps, Baseband, on single or multimode optical fiber Specified in IEEE802.3z Two strands of fiber one for transmit, one for receive Max distance varies between 550 m and 5 Km depending on different factors 8B/10B Encoding CSMA/CD for half duplex
Ethernet Cabling (100BaseTX) RJ45 connector 4 pairs of the 8 pairs in Cat5 used Two for transmit and two for receive Blue and brown wire pairs (pins 4,5,7,8) not used Two standard connections TIA/EIA 568A and TIA/EIA 568B Straight cables both sides either 568A or 568B Used to connect machines to hubs Crossover cables one side 568A and one side 568B Used to directly connect two machines (or two hubs)
568A Connection
568B Connection
Straight & Cross Cabling
Switched Ethernet Hubs are now replaced by switches (also called Layer 2 switches) Frames no longer broadcasted always, sent to only port to which destination is connected Separates the single collision domain of hub-based Ethernet to multiple collision domains Allows more than one pair to communicate simultaneously Increases bandwidth available to each machine Can work in full-duplex mode also How does the switch know which machine is connected to which port?
Switch learns! Suppose m/c A sends frame to m/c B Switch knows nothing initially, so broadcasts to all ports But switch now knows which port m/c A is connected to! If a frame comes for m/c A, it will be forwarded to only A s port Internal table built up as more and more machines communicate, completely built up when every m/c has sent at least one frame
Interconnecting LANs - Bridges Connects more than one LAN segment LANs can be of same type No modification to content or format of frame No encapsulation Exact bitwise copy of frame MAC frames relayed, so does not need LLC May have buffering to meet peak demand LANs can be of different type Needs to transform frames before sending to other LAN Ex. Ethernet to Token ring bridge
Bridge Routing How does a bridge know which frame should go to which LAN? Has a routing table Entries of the form <port, <list of destination MAC addresses>> Looks up destination MAC address and forwards to appropriate port How is the routing table built? Can be manual or automatic
Fixed Routing Complex large LANs need alternative routes Load balancing Fault tolerance Bridge must decide whether to forward frame If route for destination MAC same as port from which frame received, ignore frame, else forward appropriately Bridge must decide which LAN to forward frame on Use routing table Routing selected for each source-destination pair of LANs Done in configuration Usually least-hop route Only changed when topology changes Good for small, static LANs
Spanning Tree Algorithm Bridge automatically builds routing table Address learning Changes automatically when topology changes Frame forwarding Loop resolution
Frame Forwarding Maintain forwarding database for each port List of station addresses reached through each port For a frame arriving on port X Search forwarding database to see if MAC address is listed for any port except X If address not found, forward to all ports except X If address listed for port Y, check port Y for blocking or forwarding state Blocking prevents port from receiving or transmitting If not blocked, transmit frame through port Y
Address Learning Same principle of switched ethernet When frame arrives at port X, it has come from the LAN attached to port X Use the source address to update forwarding database for port X to include that address Timer on each entry in database Each time frame arrives, source address checked against forwarding database Transparent bridges
Loop Resolution Address learning works only for tree layout i.e. no closed loops Spanning tree constructed between bridges to avoid loops Each bridge assigned unique identifier, each port assigned a cost (default equal) Least id bridge elected root Least cost path (sum of port costs) to all bridges Exchange between bridges to establish this leastcost spanning tree IEEE802.1d
Problem with Loop
Auto-negotiation Allows two devices to negotiate speed and other parameters A 100 Mbps network card connected to a 10 Mbps port of a switch A half-duplex capable card connected to a fullduplex capable switch Can be turned on or off
Current Trends Nowadays, most new 10/100 Ethernet cards and switches support full-duplex Can auto-negotiate on connection to switch to full-duplex mode Doubles the data rate (200 Mbps on a 100BaseTX for ex., 100 Mbps in each direction) No CSMA/CD if all components can support full-duplex However, there are still hubs and half-duplex-only legacy cards Also, for interconnecting LANs of the same type, Layer 2 switches and bridges have the same functionality. Layer 2 switches are commonly used to interconnect LANs, serves as bridges. There are however pure s/w bridge codes also (part of Linux distributions).
LLC (Logical Link Control) IEEE 802.2 Provides a common interface to higher layers for data transmission Provides optional link control functionalities (error control, flow control etc.) over MAC layers Common for all IEEE 802.x MAC layers Based on HDLC (High Level Data Link Control) protocol
MAC Frame Format for 802.3 PA SFD DA SA LEN LLC PDU PAD FCS DSAP SSAP CTRL Data LLC PDU
LLC Header Fields SSAP - 8-bit address to identify Source Service Access Point (protocol) above data link layer whose data is carried by the LLC PDU DSAP 8-bit address to identify Destination Service Access Point (protocol) above data link layer to whom the data in LLC PDU will be given Control 1 or 2 bytes Data Actual data, variable sized (but multiples of bytes)
Example
Modes of Operation Unacknowledged connectionless (Type 1) no acknowledgment, flow or error control; error detection and discard at MAC level Connection-oriented (Type 2) Supports explicit connection establishment/reset/termination, flow control, sequencing, error control Acknowledged connectionless (Type 3) No connection establishment, but acknowledgements are sent by receiver and retransmissions done by sender
Frame formats to support Go-back-N or Selective Reject ARQ 7 bit sequence no. (frames numbered modulo 128) Exact frame formats skipped here (look up HDLC formats in text if interested or ask me for 802.2 specs for exact LLC frame details)