470 likes | 646 Views
CPET 355. 13. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology Indian University Purdue University, Fort Wayne. MAC Sublayers. The Channel Allocation Problem Multiple Access Protocols Ethernet Wireless LANs Broadband Wireless
E N D
CPET 355 13. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology Indian University Purdue University, Fort Wayne Prof. Paul Lin
MAC Sublayers • The Channel Allocation Problem • Multiple Access Protocols • Ethernet • Wireless LANs • Broadband Wireless • Bluetooth • Data Link Layer Switching Prof. Paul Lin
The Channel Allocation Problem • Static Channel Allocation • Frequency Division Multiplexing (FDM) – poor utilization • Time Division Multiplexing (TDM) – poor utilization • Dynamic Channel Allocation • Station Model • Single Channel Assumption • Collision Assumption • Continuous Time, Slotted Time • Carrier Sense, No Carrier Sense Prof. Paul Lin
Multiple Access Protocols • ALOHA – 1970, University of Hawaii • Pure ALOHA, Slotted ALOHA • CSMA (Carrier Sense Multiple Access) – 1975, contention-based • Persistent (1 persistent, p-persistent) and Non-persistent CSMA • CSMA/CD (Collision Detection) • CSMA/CA (Collision Avoidance) • Collision-Free Protocols (controlled-accessed) • CSMA/CA • Reservation • Polling • Token Passing Prof. Paul Lin
CSMA/CD Protocol • A multiple access network: a set of nodes or stations send and receive frames over a shared link • Time-division multiplexed bus • Carrier Sense - means that all the nodes can distinguish between an idle and a busy link Prof. Paul Lin
CSMA/CD Access Rule Step 1. All stations listen to the transmission medium. 1a. If the medium is idle, transmit; otherwise, go to step 2 (listen) 1b. If a collision is detected during transmission, transmit a brief jamming signal to ensure that all stations know that there has been a collision and then cease transmission Prof. Paul Lin
CSMA/CD Access Rule 1c. After transmitting the jamming signal, wait a random amount of time, then attempt to transmit again Step 2. If the medium is busy, continue to listen until the channel is idle, then transmit immediately Prof. Paul Lin
CSMA/CD Protocol (cont.) • Collision Detection - means that a node listens as it transmits, and can therefore detect a frame when it is transmitting has interfered (collided) with a frame transmitted by another node • When a station is in transmission, according to the CSMA/CD scheme no other station may transmit. Prof. Paul Lin
Collision Detection • If two stations transmit at once, their signals interfere with each other • Since each sender listens (sense the carrier) before the transmission, they know that there has been a collision • Both of the stations stop and wait a random amount time before next attempt to transmit Prof. Paul Lin
Medium Try Idle? again Yes Try No Transmit again Channel is Wait for a Busy random Channel Busy amount of time Transmit a brief jamming Signal CSMA/CD State Diagram Prof. Paul Lin
Multiple Access Protocols • Limited-Content Protocols • The Adaptive Tree Walk Protocol • Wavelength Division Multiple Access Protocol (WDMA) • Wireless LAN Protocols • Multiple Access with Collision Avoidance (MACA, Karn 1990) • Multiple Access with Collision Avoidance for Wireless (MACA for Wirelss, Bharghavan, et. Al, 1994) Prof. Paul Lin
Ethernet • IEEE Standards • IEEE 802.3 (Ethernet) • IEEE 802.11 (Wireless LAN) • IEEE 802.15 (Bluetooth) • IEEE 802.16 (Wireless MAN) • IEEE 802.3 • Access Methodology – CSMA/CD • Logical Topology – Broadcast • Physical Topology – Star Prof. Paul Lin
LAN Technology • MAC Lower Sublayer • Medium Access Control - Different options for IEEE 802.x • 802.3 (Ethernet, CSMA/CD or Carrier Sensed Multiple Access/Collision Detection) • 802.4 (Token Bus) - obsolete • 802.5 (Token Ring) Prof. Paul Lin
Layers of TCP/IP over LAN • Application Layer (http, ftp, telnet, etc) • TCP Layer • IP Layer • LLC Layer (Logical Link Control) • MAC Layer (Medium Access Control) • Physical Layer Prof. Paul Lin
10BaseT Ethernet Hub Server Hub Ethernet Card Station A 10BASE-T wall plate Print Server Printer 10BASE-T wall plate Transmit Ethernet Card Station B Ethernet Card Station C 10BASE-T wall plate LAN Switch Prof. Paul Lin
IEEE 802.3 - Ethernet IEEE 802.3 CSMA/CD • Carrier Sensed Multiple Access/Collision Detection • Access Medium • Base band coaxial cable • Unshield twisted pair (UTP) • Shield twisted pair • Broadband coaxial cables • Optical fiber Prof. Paul Lin
Cable Topology • Linear Bus (tap) • Spine (backbone) • Star • Tree • Mash • Segmented (repeater, bridge) Prof. Paul Lin
Ethernet • Ethernet Cabling (10 M bits/second) • 10Base5, Thick coax, 500m, 100 nodes/seg, obsolete • 10Base2, Thin coax, 185 m, 30 nodes/seg, no hub needed • 10BaseT, Twisted pair, 100 m, 1024 nodes/seg, cheapest • 10BaseF, Fiber optics, 2000 m, 1024 nodes/seg, between buildings • 100BaseT Prof. Paul Lin
Other Devices/Connections • Transceiver Tap • A connecting mechanism that allows the transceiver to tap into the cable line at any point • BNC-T connector • A T-shaped device with three ports: use for the NIC and one each for the input and output ends of cables. Prof. Paul Lin
High Speed Ethernet • 100BaseT Ethernet Cabling (CSMA/CD, IEEE 802.3u, 100 M bits/second, base band, up to 2 repeaters/hubs, 210 m) • 100BaseTX - Twisted pair, two-pair Cat 5 UTP • 100BaseT4 – 4-pair, Cat 3,4 or 5 UTP • 100BaseFX – Duplex multimode fiber-optics cable Prof. Paul Lin
Giga-Bit Ethernet • 1000BaseT Ethernet Cabling (CSMA/CD, IEEE 802.3z, 1000M bits/second) • 1000BaseSX – 850nm short wave length laser fiber-media, laying on floor • 1000BaseLX – 1300 nm long wave length laser fiber media, backbone • 1000BaseCX – Copper twinaxial cable, 25m distance, data center • 1000BaseTX – UTP Cat 5, 100 m Prof. Paul Lin
1 0 1 1 1 0 Signal Encoding • Binary Encoding • 1 = + V, 0 = -V; Prof. Paul Lin
1 0 1 1 1 0 Signal Encoding • Manchester Encoding (Ethernet) • High +0.85 V, Low -0.85 V • One bit has two equal intervals, non-return to zero • 0 – Low to high, 1 – High to low Prof. Paul Lin
Pre. SFD D.Addr S.Assr Len Data Pad CRC IEEE 802.3 Frame Format (64 to 1518 Octets) • Preamble – 7 octets or 56 bit(synch. ) • Start Frame Delimiter – 1 octet or 8-bit • Destination Address – 2 to 6 octets • Source Address – 2 to 6 octets • Length of Protocol Data Unit (PDU) – 2 octets • LLC or 802.2 Data Frame – 46 to 1500 bytes • CRC or Frame Check Sequence – 4 Octets Prof. Paul Lin
Pre. SFD D.Addr S.Assr Len Data Pad CRC IEEE 802.3 Frame Format • Minimum frame size – 64 octets • Overhead 18 octets • 46-byte min data field • Preamble • 7-bytes (56 bits) pattern of alternating 1s and 0’s (1010101..) • Alert the receiving station to the incoming frame, and enable it to synchronize its input timing. Prof. Paul Lin
Pre. SFD D.Addr S.Assr Len Data Pad CRC IEEE 802.3 Frame Format • Start Frame Delimiter (SFD) • The second field (one byte 10101011) of the frame indicates the beginning of the frame • It tells the receiver that the next thing coming is the destination address of the receiver Prof. Paul Lin
Pre. SFD D.Addr S.Assr Len Data Pad CkSum IEEE 802.3 Frame Format • Destination Address (DA) • When the packet reaches the target network, the DA field contains the physical address of the destination station • DA filed is either 2- or 6-byte for holding a unique physical address, a group address, or a global address of the packet’s next destination • DA address may hold the router connection address at the beginning if the packet must cross from one LAN to another Prof. Paul Lin
Pre. SFD D.Addr S.AssrLen Data Pad CkSum IEEE 802.3 Frame Format • Source Address (SA) • SA field is either 2- or 6-bytes for holding the frame sender’s address • Length of PDU (Protocol Data Unit) • two bytes length field for indicating the number of bytes of the data field. Prof. Paul Lin
Pre. SFD D.Addr S.Assr Len DataPadCRC IEEE 802.3 Frame Format • LLC or 802.2 Data frame • Entire data frame from 46 to 1500 bytes long • DSAP – Destination Service Access Point • SSAP – Source Service Access Point • Control • Information • CRC or FCS • 4-byte field that holds a CRC-32 (Cyclic Redundancy Check) for checking the frame integrity. Prof. Paul Lin
IEEE 802.3 Frame Format • RFC 1042 • A Standard of Transmission IP Datagrams over Ethernet • 802.2/802.3 Encapsulation Prof. Paul Lin
Ethernet Address • RFC 826 – Ethernet Addressing • NIC Address • 48-bit address in Hexadecimal Notation • An example: 06-01-02-01-21-48 • NIC Address Checking Commands: • Windows 98 - winipcfg • Windows NT/2000/XP command - ipconfig/all Prof. Paul Lin
Ethernet Address • Linux Commands: $ dmesg | grep eth divert: allocating divert_blk for eth0 eth0: 3c5x9 at 0x220, 10baseT port, address 00 60 08 14 4b da, IRQ 5. eth0: Setting 3c5x9/3c5x9B half-duplex mode if_port: 0, sw_info: 1321 eth0: Setting Rx mode to 1 addresses. Prof. Paul Lin
Ethernet Address • Source Address • Unicast - a source address is always a unicast address • Bit 0 of byte 1 • Destination Address • Multicast – received by a group of stations • Broadcast (1111 …1111) – destination address is 48-bit of all 1’s, received by all stations Prof. Paul Lin
Network Analyzer Protocol • Ethereal (Open Source) • www.ethereal.com • Data frame capture • Protocol analyzing Prof. Paul Lin
Example 1: Time needed for collision detection Question: • Two stations begin transmitting at exactly the same time. • How long will it take to realize that there has been a collision? • Contention period, delay, and throughput. Prof. Paul Lin
Example 1: Time needed for collision detection Answer: • The minimum time for detecting the collision is the time that it takes to propagate from one station to the other. Prof. Paul Lin
Example 2: Elapses time and throughput • Consider the transfer of a file containing one million characters from one station to another. • What is the total elapsed time and effective throughput for the 10BaseT star topology with a data rate of 10 Mbps? • Assume that the network setup time is negligible. Prof. Paul Lin
Example 2: Elapses time and throughput Solution: 0.8 sec. 8 bit/char x 1 M char 10 Mbits/sec = 0.8 seconds. Prof. Paul Lin
Example 3: Carrier Detection Circuit Collision detection process: • We imagine that the station’s hardware must listen to the cable while it is transmitting. • If what it reads back is different from it is putting out, it knows a collision is occurring. • A station wants to acquire the medium it must first output a 1 bit, if the channel is busy the return bit is 0, otherwise the bit is 1. Prof. Paul Lin
Busy = 1 Idle = 0 XOR Transmit =1 Ethernet Card Channel Idle = 1 Channel Busy = 0 Collision Detection Circuit Prof. Paul Lin
Example 4: Slot Time • What is the most amount of time needed for a station to know that if it be granted the access to the channel? • This time is normally called slot time. Prof. Paul Lin
Example 4: Slot Time (Calculation) • Let Tau be the time for a signal to propagate between the two farthest stations. • At time t0, station A begins transmitting. • At time t0 - t, before the signal arrive at station B which is the farthest station, the station B also begins transmission. The station B detects the collision instantaneously. Prof. Paul Lin
Example 4: Slot Time (Calculation) • But the jamming signal did not get back to the station A until (2Tau - t). • So that the most amount of the time needed to be sure that it has seized the channel is it has transmitted for 2Tau time without hearing a collision. Prof. Paul Lin
Example 5: Effective Data Rate Calculation • What is the effective data rate, excluding overhead? • Assuming that there are no collisions for a 10 Mbps Ethernet with the following specification: Prof. Paul Lin
Example 5: Effective data rate calculation • 1 km long cable that has a propagation speed of 200 m/sec. Data packets are 1024 bits long, including 32-bit header, CRC check sum and other overhead. • The first bit slot after a successful transmission is reserved for the receiver to capture the channel to send a 32-bit acknowledgement packet. Prof. Paul Lin
Example 5: Effective data rate calculation Solution: • The round trip propagation time of the cable is (200 m/sec 1 km) 2 = 10 s • And we know that a complete transmission has four phases: • Sender seizes cable (10 sec) Prof. Paul Lin
Example 5: Effective data rate calculation Solution: • Transmit data ( 1024 bits 10 Mbps = 102.4 sec) • Receiver seizes cable (10 sec) • Ack. Sent (32 bits 10 Mbps = 3.2 sec) • The sum of these time is 125.6 sec. • In this period (1024 - 32 = 992) data bits are sent, for a rate of 7.9 Mbps Prof. Paul Lin