Module 16 the Medium Access Sublayer: Ethernet
Total Page:16
File Type:pdf, Size:1020Kb
Computer Networks and ITCP/IP Protocols 1 Module 16 The Medium Access Sublayer: Ethernet Introduction The MAC or Medium Access Sublayer is part of the data link layer and needed where the media is shared between machines. We will look at two popular solutions, Ethernet and 802.11 or Wi- Fi in this module. Whenever there are multiple machines wants to communicate with each other, they need to coordinate their process otherwise there is a possibility of a chaos. If more than one sender starts sending, their signals merge into each other and resultant signal may not be recognizable at all. Such a signal is known (obviously) as garbage. This clearly means that there must be some form of arbitration needed to decide who shall send next and who shall wait. The arbitration can be done in two different ways, first, having a central arbitrator machine which decides so. Another is to use some distributed algorithm which takes consensus on all potential senders to decide who will send next. The MAC layer is designed to handle this problem and both forms of arbitration, with and without a central coordinator, are used in practice. For example, Wi-Fi, when used with access points (AP), (the infrastructure mode) the AP acts as a central arbitrator and decides who should be sending next. When the same Wi-Fi is used without an access point, (the ad hoc mode), the arbitration process is collectively decided based on specific method chosen for communication. Ethernet, in its first version, used a strategy known as "let anybody send at any point in time, resolve if there is a collision". This is also an example of distributed processing. The FDM and TDM etc. are also channel-acquisition policies which evenly distribute the available time or frequency to all communicators. We have already seen that they are not appropriate for data transmission as they are not suited for bursty traffic like data. Arbitration in ad hoc and infrastructure modes Closely look at figures 16.1 and 16.2. The access point connects all machines which want to communicate with each other. Access point authenticates them and allows them to communicate through itself. That means no two machines directly talk to each other. When a machine A wants to talk to machine B, it (A) will send it to AP and AP relays it to B. AP also decides the time and frequency to use for each machine, eliminating any possibility of collision. A collision is an event when two machines send together and their signals result into the garbage. In Ad-hoc (or Distributed Coordinated Function, DCF) mode, two machines directly talk to each other. It is possible to have both types of communication going on together. That means, it is possible that access point is arbitrating between some machines and some other machines are communicating directly. The 802.11 have carefully designed its arbitration mechanism to handle this problem. It is interesting to note that Ethernet uses a start topology which looks similar to the PCF mode. When hubs were used in the first version of Ethernet, they broadcast everything coming in and Prof. Bhushan Trivedi Module 16 Computer Networks and ITCP/IP Protocols 2 work exactly like the AP. Later on, when switches have come into use, they changed the strategy and provided point to point communication. Figure 16.1 The access point in PCF mode Figure 16.2 Ad hoc and Infrastructure mode together Ethernet Ethernet is the de-facto standard for wired LAN. Bob Metcalfe and David Boggs were the mastermind behind the design of Ethernet. They derived the inspiration from an older wireless network called ALOHA. The first popular version of Ethernet was called DIX based on initial letters of the names of the three companies which were involved in the standardization, DEC1, Intel and Xerox. It was running at the speed of 10 Mb. Later on, IEEE has also standardized the Ethernet and gave its own frame format. This version of Ethernet is now known as classic Ethernet. This classic Ethernet was designed as a broadcast network and had all the problems of broadcast networks. Later versions did not use the broadcast version so we will not stress here that further. For details please refer to reference-1. Whenever there is a collision, the Ethernet uses an algorithm called binary exponential back off. That algorithm is used in many other cases including the wireless cases, so we will study that later in this module. Later versions of Ethernet increased the speed to 100 Mb, 1 Gb, 10 Gb, 40 Gb and 100Gb. The first version used coaxial cables but later versions switched over to UTP cables and most recent versions use FO cables. For details of different types of cables used in various versions of Ethernet please refer Reference-1. For coding schemes used for those systems, refer to reference-2. Figure 16.3 Ethernet Topology Ethernet uses start topology as depicted in figure 16.3. Though the figure names the central device as hub or switch, hubs are out of vogue and hardly used. The implementation also uses a 1 DEC (Digital Equipment Corporation, later merged with Compaq which in turn merged with HP Prof. Bhushan Trivedi Module 16 Computer Networks and ITCP/IP Protocols 3 cascaded star topology which allows connecting networks together. Figure 16.4 depicts the case. Three different networks are connected using three different switches. Figure 16.4 the cascaded star topology As Ethernet was first standardized by DIX and later by IEEE, there were two different frame formats. DIX came earlier, actually more appropriate and thus normally preferred by users and vendors. That forced IEEE to accept old DIX standard as new IEEE standard. Once IEEE has accepted the old DIX standard, the Ethernet have two different frame formats, now named as Ethernet-I (the IEEE format which came later) and Ethernet II (original DIX standard which was standardized by IEEE later). We will look at both of them in the following. All later versions of the Ethernet use the same frame format and all versions of Ethernet are interoperable; that means older machines can communicate with newer switches and vice versa. How that is done is also discussed at the end of this chapter. Let us, first of all, begin with the frame structures of Ethernet. The classic Ethernet's IEEE name was 802.3 and we will use that as the synonym for Ethernet in our course. Frame structure An Ethernet frame consists of 7 (Ethernet II) to 8 (Ethernet I) fields. A minimum size of the frame is 64 bytes and the maximum is 1518 bytes (including frame headers). When virtual LAN was introduced later, the maximum frame size was increased to 1522 bytes. Figure 16.5 depicts both formats. The Ethernet standard from IEEE is also known as 802.3 and this frame format is also known as 802.3 frame format. Figure 16.5 The Ethernet frame formats Prof. Bhushan Trivedi Module 16 Computer Networks and ITCP/IP Protocols 4 In figure 16.5 the top part depicts the Ethernet II or DIX frame format and lower one depicts the Ethernet-I frame format. Both of them are valid formats but only the first one is used in practice. Both the frame formats differ at two places. The last bit of preamble is named as SOF (Start of Frame) and instead of 0, it has value 1. Second and more significant change is that Ethernet II have a field called Type which is replaced by a field called Length in the Ethernet I version. Let us look at both frame formats, field by field. The frame always has the preamble in the beginning. Technically it is not part of the frame. Our discussion about synchronization earlier had a mention of preamble of type 10101…. The receiver gets alternate zeros and ones and synchronizes properly. The first seven bytes of the preamble in both formats are the same. The final byte in Ethernet II format is 10101010 while in Ethernet-I it is 10101011. The last bit is known as SOF or Strat of Frame. The next is the Destination address. It indicates the MAC address of the receiver. In the case of Ethernet, it is 6 bytes or 48 bits long. A unicast address starts with a zero and identifies a single node. A multicast address begins with 1 and identifies a group of nodes. An address with all 48 bits as 1 is called broadcast address which identifies every node of the network. The destination address is any one of these three addresses. A group address is used to map a network group. The IP also has many groups (for example, group of all routers) and give each group a typical group address. Whenever somebody sends to a group, all members will receive that packet. How is such functionality implemented by the lower layers? Ethernet solves it by providing these groups. An IP group is mapped to an Ethernet group and actual communication to all the group members is done by such multicast address. When a network layer passes a packet with a multicast address, the Ethernet frame generated to carry that packet also contain a multicast address containing those members. If an IP packet contains a group address as its destination address, it is transmitted over a specific group using the Ethernet multicast address 01-00-5E-xx-xx-xx, where the 'x' values depend on the group identifier. The xx-xx-xx-xx values are picked up from the last 23 bits of the IP multicast address and placed here with preceding zeros if need be.