CS4470 Computer Networking Protocols 5/20/2018 CS4470 Computer Networking Protocols 4. Data Link Layer 2 Huiping Guo Department of Computer Science California State University, Los Angeles
Outline LANs Topologies Ethernet Extended LANs 4. LAN 2 CS4470_F17 5/20/2018 Outline LANs Topologies Ethernet Extended LANs 4. LAN 2 CS4470_F17
Point-to-Point communication 5/20/2018 Point-to-Point communication Each communication channel connects exactly two computers 4. LAN 2 CS4470_F17
Point-to-Point communication (cont.) Disadvantages: The number of connections grows quickly as the size of the network increases The number of connections needed for N computers is proportional to N2 Direct connections required = (N2-N)/2 The expense is especially high 4. LAN 2 CS4470_F17
Shared communication channels Local Area Networks Devised as alternatives to expensive, dedicated point-to-point connections. Rely on the shared medium A set of computers attach to a cable The computers take turns sending data Sharing reduces cost! 4. LAN 2 CS4470_F17
Comparison Networks based on the shared medium Used for LOCAL communication. Point-to-point connections Used for long-distance networks Why not shared medium? 4. LAN 2 CS4470_F17
Shared medium not suitable for long distance networks Computers attached to a shared network must coordinate use of the network Coordination requires communication, introduces longer delays Shared networks with long delays are inefficient they spend more time coordinating the use of the shared medium and less time sending data 4. LAN 2 CS4470_F17
LAN: A definition LAN --- Local Area Network 5/20/2018 LAN: A definition LAN --- Local Area Network A LAN is computer network in which devices (computers, printers) are connect to a shared medium (wire or cable) to exchange data or share resources within a small geographic area An office, the floor of a building, a building itself, or a small campus Not always clear where a “local area” ends and a “wide area” begins Some say when you need to involve a 3rd party such as a phone company or other telecom provider that’s where the “local area” ends 4. LAN 2 CS4470_F17
LANs are popular LANs are the most popular form of computer network 5/20/2018 LANs are popular LANs are the most popular form of computer network They are relatively cheap They are typically fast Deployed today in not just workplace and offices, but also in the home 4. LAN 2 CS4470_F17
Features Limited to short distance Rely on shared media Topologies 5/20/2018 Features Limited to short distance Rely on shared media Topologies Many LAN technologies exist Determined by the link layer protocol 4. LAN 2 CS4470_F17
Network Topology Specify general “shape” of a network Often applied to LAN LAN Topologies Bus Star Tree 4. LAN 2 CS4470_F17
Star topology All computers attach to a central point. hub or switch 4. LAN 2 CS4470_F17
Bus topology The computers are attached to a single , long cable (bus) Any attached computer can send a signal down the cable and all computers receive the signal. 4. LAN 2 CS4470_F17
Ring topology All computers are connected in a closed loop The ring refers to logical connection, not physical connection Data flow in one direction 4. LAN 2 CS4470_F17
Choice of Topology Reliability Expandability Performance Needs considering in context of: Medium Wiring layout Access control 4. LAN 2 CS4470_F17
Example ring network: IBM Token Ring 5/20/2018 Example ring network: IBM Token Ring Access the shared medium -- ring Use token passing token passing ring networks Media access control A computer must wait for permission before it can send data Once it obtains permission, the sending computer has complete control of the network The data pass from the sender to the next computer, then to the next computer and so on until the data pass completely around the ring and arrive back at the sender 4. LAN 2 CS4470_F17
Example ring network: IBM Token Ring (cont.) 5/20/2018 Example ring network: IBM Token Ring (cont.) Token A special reserved bit pattern which gives a computer permission to send data The token passes around the ring How to make sure data doesn’t contain the token? A computer cannot hold a token forever! Receive a token Remove it from the ring Send a frame Release the token 4. LAN 2 CS4470_F17
Example ring network: IBM Token Ring (cont.) Station waits for token before sending Signal travels around entire ring Sender receives its own transmission 4. LAN 2 CS4470_F17
Pros and Cons Advantages Disadvantages Easy detection of Broking ring Hardware failures Interference Disadvantages Each computer attached to a ring must pass bits of a frame to the next computer Failure of a single machine or link can disable the entire network Point-to-Point wiring: difficult to add/remove a satation 4. LAN 2 CS4470_F17
Failure recovery in ring networks Automatic failure recovery Introduced by FDDI Uses two rings Terminology Dual-attached Counter rotating Self healing 4. LAN 2 CS4470_F17
Illustration of failure recovery Normal operation uses one of two rings 4. LAN 2 CS4470_F17
Illustration of failure recovery Normal operation uses one of two rings Second ring used for loopback during failure 4. LAN 2 CS4470_F17
Outline LANs Topologies Ethernet Extended LANs 4. LAN 2 CS4470_F17
Ethernet Ethernet uses bus topologies “dominant” wired LAN technology: First widely used LAN technology Simpler, cheaper than token ring, FDDI and ATM Kept up with speed race: 10 Mbps – 10 Gbps 4. LAN 2 CS4470_F17
Shared medium in a LAN Shared medium used for all transmissions Only one station transmits at any time Stations “take turns” using medium Media Access Control (MAC) policy ensures fairness 4. LAN 2 CS4470_F17
Illustration Of Ethernet Transmission Only one station transmits at any time Signal propagates across entire cable All stations receive transmission CSMA/CD media access scheme 4. LAN 2 CS4470_F17
CSMA/CD Paradigm Multiple Access (MA) Carrier Sense (CS) Multiple computers attach to shared media Each uses same access algorithm Carrier Sense (CS) Wait until medium idle Begin to transmit frame CSMA plus Collision Detection (CD) Listen to medium during transmission Detect whether another station’s signal interferes 4. LAN 2 CS4470_F17
Transmitter algorithm When a station has a frame to send and the line is idle, it transmits the frame immediately There is no negotiation with other adaptors The frame size is up to 1,500 bytes which means that the station can occupy the line for only a fixed length of time When an adaptor has a frame to send and the line is busy, it waits for the line to go idle and then transmits immediately The Ethernet is said to be 1-persistent protocol because a station with a frame to send transmits with prob. 1 whenever a busy line goes idle In general, a p-persistent algorithm transmits with prob. P after a line becomes idle 4. LAN 2 CS4470_F17
Transmitter algorithm Collisions Two stations find the line idle and transmit at the same time While a station on one end starts to transmit a frame, the other station on the opposite end doesn’t sense the line busy and transmits While a station is transmitting, it keeps listing to the line If there is a collision, the station stops transmission and sends a jam signal Back off from the interference and try again 4. LAN 2 CS4470_F17
Backoff after collision Exponential backoff after the mth collision, chooses a K at random from {0,1,2,…,2m-1} waits K·512 bit times Bit time: 1 microsec for 10 Mbps Ethernet ; For K=1023, wait time is about 50 msec 4. LAN 2 CS4470_F17
Backoff after collision (cont.) Goal adapt retransmission attempts to estimated current load heavy load: random wait will be longer first collision choose K from {0,1}; delay is K· 512 bit transmission times after second collision choose K from {0,1,2,3}… after ten collisions, choose K from {0,1,2,3,4,…,1023} 4. LAN 2 CS4470_F17
Addressing: Identifying A Destination A pair of computers communicate across a LAN All other computer in the LAN receive and process each copy of the message How to avoid this? 4. LAN 2 CS4470_F17
Addressing: Identifying A Destination (cont.) Allow sender to specify destination Each station assigned unique 48-bit address: MAC address Address assigned when network interface card (NIC) manufactured Each frame contains address of intended recipient 4. LAN 2 CS4470_F17
Ethernet Address Recognition 4. LAN 2 CS4470_F17
Broadcast On Ethernet All 1s address specifies broadcast Sender Places broadcast address in frame Transmits one copy on shared network All stations receive copy Receiver always accepts frame that contains Station’s address The broadcast address 4. LAN 2 CS4470_F17
Frame header and frame format Each LAN defines the exact frame format used with the technology General format: Frame header+DATA All frames with the same LAN technology have the same header size 4. LAN 2 CS4470_F17
Ethernet Frame Structure Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used for synchronization 8 6 6 2 4 4. LAN 2 CS4470_F17
Ethernet Frame Structure (more) Addresses: 6 bytes if adapter receives frame with matching destination address, or with broadcast address it passes data in frame to net-layer protocol otherwise, adapter discards frame Type: indicates the higher layer protocol (mostly IP but others may be supported such as Novell IPX and AppleTalk) CRC: checked at receiver, if error is detected, the frame is simply dropped 4. LAN 2 CS4470_F17