Download presentation
Presentation is loading. Please wait.
1
IFSC3315-Applied Networking
Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie IFSC3315-Applied Networking Spring 2012 Chapter 2 Getting Connected Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
2
IFSC3315-Applied Networking
Spring 2012 Problems In Chapter 1 we saw networks consists of links interconnecting nodes. How to connect two nodes together? We also introduced the concept of “cloud” abstractions to represent a network without revealing its internal complexities. How to connect a host to a cloud? The term cloud in this context predates the current use of the term to indicate virtualization of the processing used to provide application support. The original definition of cloud was the abstraction of the network between the hosts exchanging data. Chapter 2 —Getting Connected
3
IFSC3315-Applied Networking
Spring 2012 Chapter Outline Perspectives on Connecting nodes Encoding Framing Error Detection Reliable Transmission Ethernet and Multiple Access Networks Wireless Networks In addition to choosing the physical medium for connecting two nodes, four other problems must be addressed. The first, encoding, is the term used for putting a bit stream onto the electrical interface to the chosen medium in a manner intelligible to the remote host. Delineating the packets of data so that they can be treated as entities at the receiver is called framing. Since the link from the local to the remote is outside the direct influence of either end, the path is subject to corruption and error detection must be implemented to locate errors. In the presence of errors a method for providing reliable delivery of information must be implemented. If the link serves more than two nodes ( Shared access ) than a structured procedure for media access control must be installed. In modern systems these five functions are generally implemented as a sub-system, either in an area of the system board or as a plug-in adaptor. For better understanding, we may say that bits are exchanged between adaptors but correct frames are exchanged between nodes. Chapter 2 —Getting Connected
4
Physically Connecting Hosts
IFSC3315-Applied Networking Spring 2012 Physically Connecting Hosts It is a mistake to look too far ahead Only one link in the chain of destiny can be handled at a time Winston Churchill This is a good viewpoint on troubleshooting, since trying to jump directly to a solution may change the situation to where when the original problem is fixed, the system is still broken. This is definitely not a good approach to design, where both the ends of the ‘chain’ and all ‘links’ are relevant during the design decision making process. Chapter 2 —Getting Connected
5
IFSC3315-Applied Networking
Spring 2012 Chapter Goal Exploring different communication medium over which we can send data Understanding the issue of encoding bits onto transmission medium so that they can be understood by the receiving end Discussing the matter of delineating the sequence of bits transmitted over the link into complete messages that can be delivered to the end node Discussing different technique to detect transmission errors and take the appropriate action Wire, fiber, and wireless dominate the media used today but other technologies are still deployed. The method bits are represented electronically or optically is called encoding It is not efficient, for a variety of reasons, to transmit an entire message at one time so the splitting up and re-constituting of the messages has a large effect on network throughput. Error handling starts with detection of errors and the most common recovery method is re-transmission. There are circumstances where more elegant methods are required, usually due to transmission time issues. Chapter 2 —Getting Connected
6
IFSC3315-Applied Networking
Spring 2012 Chapter Goal (contd.) Discussing the issue of making the links reliable in spite of transmission problems Introducing Media Access Control Problem Introducing Carrier Sense Multiple Access (CSMA) networks Introducing Wireless Networks with different available technologies and protocol Multiple network paths are one solution to reliability but the method used must extend end-to-end to operate successfully When multiple uses are made of the same network facility (channel) an organized method of accepting and sharing must be established Although wireless network have a big advantage in ease of connectivity they offer much greater exposure to interference and interception. Chapter 2 —Getting Connected
7
Perspectives on Connecting
IFSC3315-Applied Networking Spring 2012 Perspectives on Connecting As an example of a node, consider a workstation class machine. This machine is capable of multi-processing and can execute local applications in addition to functioning as a network host. With proper software configuration, the machine could function as a network device, doing routing or switching with multiple network interfaces. Early network devices were actually implemented this way but the normal situation now is for dedicated hardware devices to be used for network functions. An end-user’s view of the Internet Chapter 2 —Getting Connected
8
Hardware Building Blocks
IFSC3315-Applied Networking Spring 2012 Hardware Building Blocks Nodes General Purpose Computers Network Node ( router, switch) File server (warehouse) We will look at the internal structure of such a workstation to help in later analysis of how an end node ( or station ) interacts with the network and how this may affect overall network performance. Three main features: Memory Size, Adaptor (NIC) type and characteristics, System speed. Memory size is important because, like link bandwidth, it is a fixed quantity that must be conserved as a scarce resource. All of the data in a packet must be stored in memory until the network acknowledges successful delivery. In a congested network, the required queuing of transmit requests can use significant amounts of memory. The network adapter and it’s associated driver must be considered when calculating performance, More on this later. The speed of both processors and memory can have direct effect on Network performance. CPU speeds are increasing almost exponentially but memory speed improvements average only 7% per year. Memory latency had a direct effect on network speed, since all data packets are assembled and transferred to the NIC using system memory. Therefore, >processor speed != >network speed Chapter 2 —Getting Connected
9
IFSC3315-Applied Networking
Spring 2012 Network Adapter A network adapter has two main components, the bus interface for communications with the host computer and the network interface for communication with the network. The control and status registers are used to set up the interface for the protocol to be used and to be able to read the current status of the interface. The Control and Status Registers (CSR) are typically ‘mapped’ into memory and can be addressed just like the system main memory. Either direct I/O or DMA can be used to move data from the computer to the NIC. The terms frame and message are used to describe network data but have slightly different meanings and depend on context. The unit of traffic on the network side of the adapter is the frame and network adapters are responsible for error free transmission of frames between adapters. Messages are one or more frames taken together and interpreted together by the higher level layers in the software. A page of text or images may be split into multiple frames for transmission over the network and then reassembled at the far end into the source page. Each frame may have redundant data added by the transmitter that is used to validate the frame at the destination before it is passed on to the next layers of the destination software. Chapter 2 —Getting Connected
10
IFSC3315-Applied Networking
Spring 2012 Memory Bandwidth As mentioned, memory speeds are often the limiting factor in network performance. In this example the bandwidth of the CPU/Memory interface is 3.2 Gbps and from memory to the I/O bus is 8.5 Gbps. The frame, or block, size of each data segment comes into play since there is overhead associated with each bus access. In a typical architecture there is the need for 16 clock cycles to move a 64 byte frame (The minimum length for an Ethernet packet), 8 for acquiring the bus and 8 for transmitting the data. This cuts the effective bandwidth in half Chapter 2 —Getting Connected
11
Link Capacity and Shannon-Hartley Theorem
IFSC3315-Applied Networking Spring 2012 Link Capacity and Shannon-Hartley Theorem Gives the upper bound to the capacity of a link in terms of bits per second (bps) as a function of signal-to-noise ratio of the link measured in decibels (dB). C = Blog2(1+S/N) Where B = 3300 – 300 = 3000Hz, S is the signal power, N the average noise. The signal to noise ratio (S/N) is measured in decibels is related to dB = 10 x log10(S/N). If there is 30dB of noise then S/N = 1000. Now C = 3000 x log2(1001) = 29,902bps. How can we get 56kbps? The signal to noise ratio is the ratio of the signal power (S) to the noise power present on the link(N) with no signal present. It is typically specified (or measured) using a logarithmic scale with the units of decibels. In the example we have a 3000Hz wide voice channel and have an Sndb of 30. This translates to a power ratio of 103 = To calculate log2 from log10 use the formula: log2(N) = log10 (N) / log10 (2) . log10 (1001) = ; log10 (2) = ; log2(1001) = / = 9.967; Without software compression this would imply that a 28.8Kbps modem is near the limit. Compression and changes to the telephone system have made some speeds past this limit available, but only in special cases. For example, the 56Kbps modem requires that the ISP be digitally connected to the central office providing the connection (effectively increasing the S/N). The 56Kbps rate is only possible for downloading. Uploading is limited to The variation in actual S/N when you make a call accounts for the different line speeds that you may connect at. The exchange of tones between the two modems during a dial-up connect sequence are actually measurements of near and far end noise and end to end loss for a S/N calculation which is then used to make a selection of transmission bandwidth. Chapter 2 —Getting Connected
12
IFSC3315-Applied Networking
Spring 2012 Links All practical links rely on some sort of electromagnetic radiation propagating through a medium or, in some cases, through free space One way to characterize links, then, is by the medium they use Typically copper wire in some form (as in Digital Subscriber Line (DSL) and coaxial cable), Optical fiber (as in both commercial fiber-to-the home services and many long-distance links in the Internet’s backbone), or Air/free space (for wireless links) Twisted pair cable is used for many telephone distribution applications. For network twisted pair cable the so-called Category specifications are used. Abbreviated as CAT and a number, (Ex: Most telephone in house wiring will pass CAT-3 specifications) the increasing numbers indicate more stringent manufacturing requirements. CAT-5 cable has larger conductors than CAT-3 and also has significantly more twists per inch than CAT-3. There is twisted pair cable specified for Gigabit Ethernet but the limited distance supported means that the usual distribution medium is fiber optic cable. Thin-net is about 3/16” in diameter and uses BNC type connections. Thick-net is about 5/8” diameter and fairly rigid. A type of piercing adapter (called a ‘vampire tap’) is used to connect at intermediate points in the cable. Multi-mode fiber ( typically 62.5/125 micron ) has a core diameter such that several modes of standing waves (modes) can be present in the cable. Single mode fiber (typicall 8./125 micron) has a smaller core diameter such that only the direct mode of transmission is possible. Wireless networks can be point to point ( single access point – single host ) or cellular in nature. Multiple access points, hosts roam and select the channel with the best S/N ratio. Typically 2.4Ghz (US). Can include built in encryption. See the textbook (Sec2.7.2)for a description of Bluetooth, a 2.45 Ghz wireless technology designed to eliminate wire in offices and for point-of-sale use. I t is now widely used to connect headsets to cell phones and in cars to automate use of mobile devices Another emerging standard (ZigBee) is a low-power extension of Bluetooth Chapter 2 —Getting Connected
13
IFSC3315-Applied Networking
Spring 2012 Links Another way to characterize links is how many bit streams are simultaneously supported on a link Single: Nodes on link must share access. May be called half-duplex. Two: May allow simultaneous operation in both directions (full-duplex) If only a single bit-stream is possible then some procedure will be implemented so that when one end of the link is sending the other end of the link is receiving. For the example of a terminal, this is not a problem since the terminal users typically types a command and waits for a response. For the more complicated case of file transfer some kind of logic program would have to control the link. In any case you can readily see the limitations of this kind of link. Luckily, half- duplex links are increasingly rare in today's networks. If two bit-streams are permitted then simultaneous bi-directional communication is possible. Example: When you telnet into a host and type a character the ‘echo’ you see on your screen of your typed characters is coming over the second bit-stream from the host. One of the symptoms of a response time problem is a slow echoing of typed characters. Cellular networks are full-duplex by using separate frequencies for receive and transmit. Chapter 2 —Getting Connected
14
IFSC3315-Applied Networking
Spring 2012 Links Another important link characteristic is the frequency Measured in hertz, with which the electromagnetic waves oscillate Distance between the adjacent pair of maxima or minima of a wave measured in meters is called wavelength Speed of light divided by frequency gives the wavelength. Frequency on a copper cable range from 300Hz to 3300Hz; Wavelength for 300Hz wave through copper is speed of light on a copper / frequency 2/3 x 3 x 108 /300 = 667 x 103 meters. Placing binary data on a signal is called encoding. Modulation involves modifying the signals in terms of their frequency, amplitude, and phase. The speed of the signal on the media and the frequency of the applied data signal determine the wavelength of the signal on the media. Later we will translate this into a figure representative of the link capacity. The method used to place the binary signal on the media is called encoding and represents both the electrical amplitude and the bit equivalent of the data. The two common types of modulation, frequency and amplitude, are represented in FM and AM radio. Old analog television transmissions used phase modulation in the transmission of the video portion of the signal. Chapter 2 —Getting Connected
15
IFSC3315-Applied Networking
Spring 2012 Links Regardless of the medium selected for use as a network link, the transmission occurs within the electromagnetic spectrum. The speed of light(and all electro-magnetic waves) in a vacuum is 3x108 m/s. It’s speed in any other medium will be a fraction of this maximum value. For example an approximation of propa-gation speeds in copper or fiber is 2/3 the speed in a vacuum. Encoding binary information onto a link is a complex topic and will not be extensively studied in this course. A characteristics that applies to encoding binary data onto a link that we will discuss is modulation: sending the binary data using only two discrete levels of signal. Modulation refers to a signal added to a carrier signal that carries the desired information. Types of modulation are named for the characteristic of the carrier that is modified by the modulation: frequency, amplitude, or phase. Both am and fm are used in commercial radio broadcasting. Many modems use phase modulation and it is a part of video broadcasting. For our purposes, amplitude modulation of light could be on or off. Further detail on this topic is beyond the course scope. We will only consider the result of modulation: it is possible to transmit a pair of distinguishable levels across a link. We will discuss details of how those two levels are used to encode binary data.. Electromagnetic spectrum Chapter 2 —Getting Connected
16
IFSC3315-Applied Networking
Spring 2012 Links Leased lines are purchased from a common carrier to interconnect sites not at the same geographic location. There are many charging details. Typically you would pay for a point-to-point link from your local site to a serving central office. You would then get a link from the remote site to it’s local central office. The carrier would then arrange a link between the two segments you just purchased. Consider that your local carrier, the remote local carrier, and the long distance provider(s) may all be different. Then consider the ‘fun’ of trying to get one of the above to step up and accept responsibility when problems occur. Link charges can either be based on bandwidth*length or on registered throughput CATV and DSL are competing technologies to get internet services to the home. Of the two, CATV is the more limited. Since the bandwidth provided by a DSL connection is dedicated to each individual user and with CATV the total bandwidth is shared among all simultaneous users it is possible for a CATV connection to degrade with increase usage when compared to a properly designed DSL network.. Common services available to connect your home Chapter 2 —Getting Connected
17
IFSC3315-Applied Networking
Spring 2012 Links US & Canada AMPS (1G-analog) – original analog technology PCS (2G) – digital framework – largley replaced AMPS CDMA(3G-4G) spread spectrum – smart phones Non US GMS – Global Mobile Systems-also different frequency Satellite – Big advantage in undeveloped areas Infrared – Up to 1 Mbps at ranges up to 10m IEEE GHz carrier(5Ghz in future)54Mbps Bluetooth™ 2.45Ghz,1Mbps,10m range (piconets) Analog technology, originally aimed at voice, is rapidly being replaced by digital facilities. Dual/Multi mode phones make transition less apparent to users. LSI technology greatly simplifies deployment of handsets since a handset can work with a variety of systems. Satellite systems have not expanded as quickly as forecast since the major markets can also utilize ground based systems. As usage expands into areas with limited, or non-existent infrastructure satellite system will have a window of opportunity. Infrared was widely used for PDA and laptop communication with desktop machines. Less used for LAN deployment. Bluetooth is now standard for this use IEEE802.11b is now deployed but business (E-business) use has been limited due to design problems with cryptographic strength. The IEEE802.11a standard addresses these problems. IEEE802.11n allows up to 54Mbps of data bandwiceh. Section 2.7 of text discusses this protocol. Bluetooth IEEE was designed for ubiquitous use for both LAN deployment, POS (point of sale) usage, and office automation to eliminate desktop wiring. A common usage now is for a headset to use bluetooth to connect to a cellphone carried by the user, eliminating any headset wiring. Most new vehicles include Bluetooth networking for mobile devices. Chapter 2 —Getting Connected
18
IFSC3315-Applied Networking
Spring 2012 Encoding Signals travel between signaling components; bits flow between adaptors Encoding is the term used to describe the process whereby digital information is electrically placed on the link for transfer to the remote end of the link. Several methods have been used and the actual decision of which method should be used will be based on several factors ( desired speed, desired cost, desired distance capability, etc ) Two common schemes are to modulate electromagnetic waves. Another is to vary a dc voltage level. A common encoding scheme, used for short distances, is called Non-Return to Zero, abbreviated as NRZ. In NRZ there are two possible voltage levels applied to the line. A binary one will be represented by one of the voltages, a binary zero by the other voltage. The threshold the receiver uses, to distinguish between a one and a zero, is typically set to the midpoint of the two voltage levels NRZ encoding of a bit stream Chapter 2 —Getting Connected
19
Encoding-Bits and Baud
IFSC3315-Applied Networking Spring 2012 Encoding-Bits and Baud Baud syn.=symbol. Baud rate = No. of symbols that can be transmitted in a second. Bit = binary digit. If each Baud (Symbol) represents 1 bit then the bit rate = baud rate. If more than one symbol is transmitted per bit (special codes such as Manchester) Then bit rate < baud rate. If a symbol represents more that 1 bit then bit rate > baud rate. The baud rate is directly related to the bandwidth of the line. A symbol (baud) takes a specific time to be placed on the line and detected at the far end. For example, if tone vs no-tone are the two symbols then there is a minimum length tone burst (and a minimum length quiet interval) that will be detectable at the far end. From this the baud rate can be determined. For example, if two people are trying to communicate by speaking eventually a distance will be reached where it will be difficult to understand the syllables of the speech. The first step may be to speak slower to attempt to understand the signal. A different example would be for 4 different frequencies tones to be used to signal information. Lets say that it is possible to detect up to 2400 of changes in tone per second. This would be a 2400 baud connection. Since there are four possible states this could represent 2 binary digits of information: 00, 01, 10, 11. Thus a baud = 2 bits and the bit rate for this link would be 4800 bps. Chapter 2 —Getting Connected
20
IFSC3315-Applied Networking
Spring 2012 Encoding Problem with NRZ Baseline wander The receiver keeps an average of the signals it has seen so far Uses the average to distinguish between low and high signal When a signal is significantly low than the average, it is 0, else it is 1 Too many consecutive 0’s and 1’s cause this average to change, making it difficult to detect If the data had an even number of ones and zeros the average value of the signal would lie at the threshold. The problem is that most data will not have a truly random distribution of ones and zeros. (EX: ASCII code that uses 8 bits to represent characters of data has certain bits that will always be ‘1’ if the character is printable.) This means that the average value of the resultant bit stream will not be at the midpoint of the two voltage levels. As distance or other line characteristics are taken into account the detector can have enough bias from this shift to be unable to detect the desired level changes in the signal. This problem would be greatly exacerbated by a bit stream of either continuous 1’s or continuous 0’s . Chapter 2 —Getting Connected
21
IFSC3315-Applied Networking
Spring 2012 Encoding Problem with NRZ Clock recovery Frequent transition from high to low or vice versa are necessary to enable clock recovery Both the sending and decoding process is driven by a clock Every clock cycle, the sender transmits a bit and the receiver recovers a bit The sender and receiver have to be precisely synchronized A second problem with NRZ is the recovery of clock(synchronization) information. The receiver wants to be able to sample the received signal at the center of each transmitted bit interval to maximize the chances of correct detection. The transitions of the received signal are typically used to adjust the clock of the receiver and to locate the mid-point of each bit interval. Both the baseline wander symptom and the continuous 1’s or 0’s symptom would interfere with clock synchronization. Chapter 2 —Getting Connected
22
IFSC3315-Applied Networking
Spring 2012 Encoding NRZI Non Return to Zero Inverted Sender makes a transition from the current signal to encode 1 and stay at the current signal to encode 0 Solves for consecutive 1’s NRZI adds extra transitions to the signal based on the past level and the data input. Since consecutive ones will still produce transitions on the line this solves the problem of consecutive 1’s Chapter 2 —Getting Connected
23
IFSC3315-Applied Networking
Spring 2012 Encoding Manchester encoding Merging the clock with signal by transmitting Ex-OR of the NRZ encoded data and the clock Clock is an internal signal that alternates from low to high, a low/high pair is considered as one clock cycle In Manchester encoding 0: low high transition 1: high low transition With Manchester encoding, used for Ethernet, the clock signal is merged with the data bits. This means that even with consecutive 1’s and 0’s the output will have transitions. Chapter 2 —Getting Connected
24
IFSC3315-Applied Networking
Spring 2012 Encoding The NRZ signal has the aforementioned problems with consecutive ones and zeros. NRZI, which specifies that a ‘1’ is indicated by a mid-bit transition and a ‘0’ by no mid-bit transition. This method takes care of continuous ‘1’s but leaves the problem of consecutive zeros. In Manchester encoding the transmit clock is exclusive or’d with the NRZ signal. This produces a rising mid-bit transition for a ‘0’ and a falling mid-bit transition for a ‘1’ The problem is that the extra transitions must be electrically transmitted as part of the data stream, effectively doubling the bandwidth usage. As discussed earlier, this is a case where the baud rate is twice the bit rate. Different encoding strategies Chapter 2 —Getting Connected
25
IFSC3315-Applied Networking
Spring 2012 Encoding 4B/5B encoding Insert extra bits into bit stream so as to break up the long sequence of 0’s and 1’s Every 4-bits of actual data are encoded in a 5- bit code that is transmitted to the receiver 5-bit codes are selected in such a way that each one has no more than one leading 0(zero) and no more than two trailing 0’s. No pair of 5-bit codes results in more than three consecutive 0’s Table 2.2 on pg. 82 illustrates another scheme to lessen the effect of consecutive ‘1’s and ‘0’s without the 50% degradation of Manchester encoding. The 4B/5B codes take each 4 bit sequence of input data and generate a five bit representative pattern. This is only a 20% loss in efficiency. The codes for each 4-bit sequence are chosen so that they have no more than one leading zero and no more than two trailing zeros. This means that when strung together there will be no more than three consecutive zeros. The consecutive ones problem is addressed by taking the resulting 5 bit sequences and encoding them on the link using NRZI. A 5 bit code has 25 or 32 codes available. The 16 codes used to represent valid 4 bit data groups leave 16 more five bit codes available for use by the link protocol for management tasks. Chapter 2 —Getting Connected
26
IFSC3315-Applied Networking
Spring 2012 Encoding 4B/5B encoding Data Code 0000 left 0001 – when the line is idle 0010 – when the line is dead – to mean halt .. 1111 left : 7 invalid, 6 for various control signals The 16 additional (unused) 5 bit sequences are used by the hardware to send signals from end to end for control of the line. Since none of the 16 codes will appear in valid data they can be stripped off at the receiving end and used to execute control functions such as start, stop, reset, etc Chapter 2 —Getting Connected
27
IFSC3315-Applied Networking
Spring 2012 Framing We are focusing on packet-switched networks, which means that blocks of data (called frames at this level), not bit streams, are exchanged between nodes. It is the network adaptor that enables the nodes to exchange frames. Node A notifies Adaptor A that it has a frame to send and passes the memory location of the frame. Adaptor A places the frame on the link as a bit stream. Adaptor B recovers the frame from the bit stream and passes it to a memory location specified by Node B. Adaptor A and Adaptor B must use the same electrical conversion specifications when applying and recovering the bit stream on the link. Ex: 4B/5B, Manchester, NRZI Bits flow between adaptors, frames between hosts Chapter 2 —Getting Connected
28
IFSC3315-Applied Networking
Spring 2012 Framing Byte-oriented Protocols To view each frame as a collection of bytes (characters) rather than bits BISYNC (Binary Synchronous Communication) Protocol Developed by IBM (late 1960) DDCMP (Digital Data Communication Protocol) Used in DECNet When networking was not universal and covered by international standards each vendor was likely to develop their own proprietary scheme for interconnecting devices. Chapter 2 —Getting Connected
29
IFSC3315-Applied Networking
Spring 2012 Framing BISYNC – sentinel approach Frames transmitted beginning with leftmost field Beginning of a frame is denoted by sending a special SYN (synchronize) character Data portion of the frame is contained between special sentinel character STX (start of text) and ETX (end of text) SOH : Start of Header DLE : Data Link Escape CRC: Cyclic Redundancy Check In Bisync ( Binary Synchronous Protocol – IBM late 60’s ) a frame is a collec-tion of characters rather than a stream of bits. This approach to framing is called the sentinal approach. In Bisync there are designated sentinal characters ( SYN, DLE,STX,ETX, etc ) that delimit different part of the frame and surround the data. The data segment of the frame starts with a sentinal (STX) and ends with another sentinal (ETX). A Block Check Count (BCC) is calculated for the frame at the transmitter and added to the end of the frame. At the receiver the BCC is again calculated as the frame is received and compared to the receeived BCC. Chapter 2 —Getting Connected
30
IFSC3315-Applied Networking
Spring 2012 Framing BISYNC Frame Format Byte Stuffing If sentinel characters must be included in the data segment of a frame (such as transmitting binary data) two methods of byte stuffing are used. For individual characters a special sentinel (DLE) is inserted in the data stream. The receiver removes the DLE and does not interpret the next character as a sentinel if it happens to match a sentinel code. For full binary data segments, the Start of text and End of text characters are preceded by DLE sentinels to prevent any data characters in the segment from being interpreted as sentinels until the compound DLE-ETX sequence is received. This method was still not perfect for transmission of true binary data but, of course, it was not designed when binary data was that common in the network. Most data was textual in nature, not graphical as it the norm now. For example, if the sequence (DLE)(ETX) occurred in the binary data, a low but not zero probability, that frame would never be received properly and would hang the line when transmitted. I encountered this exact problem several times where a file containing this pattern could never be sent on the bisync network. I spent a lot of time on the first occurrence before discovering the actual problem. Chapter 2 —Getting Connected
31
IFSC3315-Applied Networking
Spring 2012 Framing Recent PPP which is commonly run over Internet links uses sentinel approach Special start of text character denoted as Flag Address, control : default numbers Protocol for demux : IP / IPX Payload : negotiated (1500 bytes) Checksum : for error detection PPP stands for point-to-point protocol was a early method for serial data communication over modems. Notice that the frame payload was limited to 1500 bytes. To send a larger data segment it must be broken into individual packets and then placed in frames. Chapter 2 —Getting Connected
32
IFSC3315-Applied Networking
Spring 2012 Framing Sentinel-based delineate frame with special pattern: e.g., HDLC, SDLC, PPP PPP Frame Format problem: special pattern appears in the payload solution: bit stuffing sender: insert 0 after five consecutive 1s receiver: delete 0 that follows five consecutive 1s Bit oriented protocols are more flexible for sending binary and other truly random data. A frame is a collection of bits. Ex. HDLC ( A standardization by the OSI of IBM’s SDLC protocol ) High-Level Data Link Control. The sentinel for HDLC is the 8 bit flag sequence : Any time the receiver sees 6 1’s in a row it can assume that a flag sequence has been sent. If the transmitter wants to send data containing 5 or more 1’s it will always insert a 0 after the five 1’s. When the receiver gets five 1’s in a row it looks at the next bit. If it is a one then it has received a flag. If it is a zero then it discards the zero and starts copying the next bit ( 1 or 0 ) as data. Both Byte and Bit oriented protocols are data link layer ( OSI layer 2 ) protocols. See the shaded section on Page 87 for the books use of definitive layer descriptions. Again, we will focus more on actual implementations and fall back on the OSI model, where appropriate, to emphasize specific protocol details Chapter 2 —Getting Connected
33
IFSC3315-Applied Networking
Spring 2012 Framing Counter-based include payload length in header e.g., DDCMP DDCMP Frame Format In counter based protocols the header of the frame is specifically formatted to provide information about the rest of the frame, eliminating the need for sentinel characters after the frame start sequence. In DDCMP, above, the count tells where the data ( body ) of the frame starts and how long it is. Obviously a receive error in the count field would render it unlikely that the frame would be correctly received. Since the CRC is sent immediately following the body segment the loss of count would mean that the actual CRC would not be stored for comparison with the one generated on the fly by the receiver. The resulting CRC error would result in a frame rejection just as if the data error was within the data segment. In DDCMP, for example, a count error that increases the expected frame length beyond the actual length could affect both the bad frame and the following frame(s) until the count runs out. problem: count field corrupted solution: catch when CRC fails Chapter 2 —Getting Connected
34
IFSC3315-Applied Networking
Spring 2012 Framing Clock-based each frame is 125us long e.g., SONET: Synchronous Optical Network STS-n (STS-1 = Mbps) A clock based framing approach ( Such as SONET) uses fixed length frames. This is a gross simplification (As the book points out the SONET spec is larger than the textbook ) but the main feature of clock based framing is that the special framing sequences occur at fixed intervals so bit sequences that match the special framing sequence but occur within the frame boundary will not be interpreted as special. This eliminates the need for bit stuffing and thus simplifies the processing of the received bit stream. This is good since SONET was typically designed for much faster links than were used with BISYNC or HDLC. If we look at STS-1, the lowest SONET link rate, the bit rate is Mbps. An STS-1 frame is 9 rows of 90 bits ( 810 bits ) each of the 9 rows has it’s first three bits dedicated to overhead functions with the remaining 87 bits in the row available for totally free format data. The two byte special framing sequence will only be used for alignment if the receiver detects exactly 810 bits between sequences. STS-48 has a bit rate of Gbps. Since each higher frame bit rate is a direct multiple of the base rate it becomes straightforward to combine lower speed frames into higher speed frames, and vice-versa, while minimizing buffer requirements. There is a more detailed description for SONET in the text but we will not go much further into the topic. The discussion of how SONET multiplexes the lower rate channels onto higher ones is worth reading as it will help in the understanding of later topics. Chapter 2 —Getting Connected
35
IFSC3315-Applied Networking
Spring 2012 Error Detection Bit errors are introduced into frames Because of electrical interference and thermal noises Detecting Error Correction Error Two approaches when the recipient detects an error Notify the sender that the message was corrupted, so the sender can send again. If the error rate is low, then the retransmitted message will be error-free Using some error correct detection and correction algorithm, the receiver reconstructs the message If we are monitoring the line in some manner or have been given a specific error rate as a guarantee we are looking at a random distribution. We cannot depend on the probability of ‘good’ random distributions. We must design for the ‘worst’ of random distribution. We will not discuss error correction since the usage of error correction for responding to transmission errors, rather than just using retransmission, is usually in special circumstances. See the shaded area on pg. 101 in the text for a short discussion of the topic.. Consider sending and receiving from a long distance, such as to a spacecraft more than a million miles away. First, the error rate is higher to begin with and second, retransmission may drop the throughput below acceptable levels. In the presence of a high error rate, it is possible that the bandwidth needed for retransmissions may exceed that needed for the original data transmission. Chapter 2 —Getting Connected
36
IFSC3315-Applied Networking
Spring 2012 Error Probability If we have the gross error rate (Ex: 1 in 107) and the packet size ( Ex:104 bits ) we can estimate the number of packets with single bit errors: 107/104 = 10-3 (actually ) Parity would find these For more complex case of how many packet would have 2 bit errors P=5x10-7 (see pg 96) and simple parity would fail to detect these. Simple parity can detect single bit errors but not any even number of bit errors. Chapter 2 —Getting Connected
37
IFSC3315-Applied Networking
Spring 2012 Error Detection Common technique for detecting transmission error CRC (Cyclic Redundancy Check) Used in HDLC, DDCMP, CSMA/CD, Token Ring Other approaches Two Dimensional Parity (BISYNC) Checksum (IP) Parity is a simple technique of counting the 1’s in a fixed number of bits and then adding a redundant bit to make the total either even or odd. The receiver reads the fixed bit pattern and makes the same comparison. If the calculated parity matches that sent with the data the segment is accepted. Chapter 2 —Getting Connected
38
IFSC3315-Applied Networking
Spring 2012 Error Detection Basic Idea of Error Detection To add redundant information to a frame that can be used to determine if errors have been introduced Imagine (Extreme Case) Transmitting two complete copies of data Identical No error Differ Error Poor Scheme ??? n bit message, n bit redundant information Error can go undetected In general, we can provide strong error detection technique k redundant bits, n bits message, k << n In Ethernet, a frame carrying up to 12,000 bits of data requires only 32-bit CRC In the internet it is common to use a check sum where the bits are formed into a table and the table is added using binary addition. The sum is transmitted as the redundant data pattern. A similar sum is calculated at the receiver and used to test against the sum sent with the data. Good for single bits, low number of additional bits needed, many combination errors will go undetected. Chapter 2 —Getting Connected
39
IFSC3315-Applied Networking
Spring 2012 Error Detection Extra bits are redundant They add no new information to the message Derived from the original message using some algorithm Both the sender and receiver know the algorithm Sender Receiver Receiver computes r using m If they match, no error m r m r The redundant data, which is added by the sender and removed by the receiver before moving the frame to the next layer, constitute overhead. The throughput is reduced by the percentage dedicated to error detection so it is prudent to use an efficient error detection method. Chapter 2 —Getting Connected
40
Two-dimensional parity
IFSC3315-Applied Networking Spring 2012 Two-dimensional parity Two-dimensional parity is exactly what the name suggests It is based on “simple” (one-dimensional) parity, which usually involves adding one extra bit to a 7-bit code to balance the number of 1s in the byte. For example, Odd parity sets the eighth bit to 1 if needed to give an odd number of 1s in the byte, and Even parity sets the eighth bit to 1 if needed to give an even number of 1s in the byte In addition to the overhead needed on the link to transmit the redundant error detection data, there is processing overhead at both the sender and receiver to make the necessary calculations. Chapter 2 —Getting Connected
41
Two-dimensional parity
IFSC3315-Applied Networking Spring 2012 Two-dimensional parity Two-dimensional parity does a similar calculation for each bit position across each of the bytes contained in the frame This results in an extra parity byte for the entire frame, in addition to a parity bit for each byte Two-dimensional parity catches all 1-, 2-, and 3-bit errors and most 4-bit errors Simple parity adds 1 bit to a 7 bit code. This is about a 14% overhead but only catches a limited number of errors. Two dimensional parity, if used for a frame of 8 x 7 bit codes would add a total of 16 bits to the 56 bits of actual data. This is an overhead of 28% but has a much higher probability of detecting errors. Chapter 2 —Getting Connected
42
Two-dimensional parity
IFSC3315-Applied Networking Spring 2012 Two-dimensional parity Each row has simple parity added to the end of the code then each vertical column is considered as another code generating an additional bit of parity which is sent as an additional entire code at the end of the frame. This will catch all 1, 2, and 3 bit errors and many 4 and larger bit errors. Two Dimensional Parity Chapter 2 —Getting Connected
43
Internet Checksum Algorithm
IFSC3315-Applied Networking Spring 2012 Internet Checksum Algorithm Not used at the link level Add up all the words that are transmitted and then transmit the result of that sum The result is called the checksum The receiver performs the same calculation on the received data and compares the result with the received checksum If any transmitted data, including the checksum itself, is corrupted, then the results will not match, so the receiver knows that an error occurred The advantage of checksum calculations is that they are fairly easy to implement in code, fairly efficient in terms of overhead, and also fairly accurate in detecting errors. Chapter 2 —Getting Connected
44
Internet Checksum Algorithm
IFSC3315-Applied Networking Spring 2012 Internet Checksum Algorithm Consider the data being checksummed as a sequence of 16-bit integers. Add them together using 16-bit ones complement arithmetic (explained next slide) and then take the ones complement of the result. That 16-bit number is the checksum Chapter 2 —Getting Connected
45
Internet Checksum Algorithm
IFSC3315-Applied Networking Spring 2012 Internet Checksum Algorithm In ones complement arithmetic, a negative integer −x is represented as the complement of x; Each bit of x is inverted. When adding numbers in ones complement arithmetic, a carryout from the most significant bit needs to be added to the result. Chapter 2 —Getting Connected
46
Internet Checksum Algorithm
IFSC3315-Applied Networking Spring 2012 Internet Checksum Algorithm Consider, for example, the addition of −5 and −3 in ones complement arithmetic on 4-bit integers +5 is 0101, so −5 is 1010; +3 is 0011, so −3 is 1100 If we add 1010 and 1100 ignoring the carry, we get 0110 In ones complement arithmetic, the fact that this operation caused a carry from the most significant bit causes us to increment the result, giving 0111, which is the ones complement representation of −8 (obtained by inverting the bits in 1000), as we would expect Chapter 2 —Getting Connected
47
Cyclic Redundancy Check (CRC)
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check (CRC) Reduce the number of extra bits and maximize protection Given a bit string we can associate a polynomial on a single variable x for it. 1.x5+1.x4+0.x3+0.x2+0.x1+1.x0 = x5+x4+1 and the degree is 5. A k-bit frame has a maximum degree of k-1 Let M(x) be a message polynomial and C(x) be a generator polynomial. Chapter 2 —Getting Connected
48
Cyclic Redundancy Check
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check Add k bits of redundant data to an n-bit message want k << n e.g., k = 32 and n = 12,000 (1500 bytes) Represent n-bit message as n-1 degree polynomial e.g., MSG= as M(x) = x7 + x4 + x3 + x1 Let k be the degree of some divisor polynomial e.g., C(x) = x3 + x2 + 1 The general method for detecting errors in bit streams is to add redundant data to the stream on the premise that an error in the data payload will be detected by regenerating the redundant data at the receiver and comparing it to that received with the data payload. In parity the computation is simple but the detection sensitivity is limited. Cyclic redundancy checks are more computationally intensive but if correctly implemented will usually be very close to 100% effective. Typically a low number of bits are needed for most applications. For example a 32bit (4 byte) CRC when used with a 1500 byte packet takes less than 0.3% of the bandwidth to implement. Chapter 2 —Getting Connected
49
Cyclic Redundancy Check (CRC)
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division Chapter 2 —Getting Connected
50
Cyclic Redundancy Check (CRC)
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check (CRC) Properties of Generator Polynomial Let P(x) represent what the sender sent and P(x) + E(x) is the received string. A 1 in E(x) represents that in the corresponding position in P(x) the message the bit is flipped. We know that P(x)/C(x) leaves a remainder of 0, but if E(x)/C(x) leaves a remainder of 0, then either E(x) = 0 or C(x) is factor of E(x). When C(x) is a factor of E(x) we have problem; errors go unnoticed. If there is a single bit error then E(x) = xi, where i determines the bit in error. If C(x) contains two or more terms it will never divide E(x), so all single bit errors will be detected. Chapter 2 —Getting Connected
51
Cyclic Redundancy Check (CRC)
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check (CRC) Properties of Generator Polynomial In general, it is possible to prove that the following types of errors can be detected by a C(x) with the stated properties All single-bit errors, as long as the xk and x0 terms have nonzero coefficients. All double-bit errors, as long as C(x) has a factor with at least three terms. Any odd number of errors, as long as C(x) contains the factor (x+1). Any “burst” error (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. (Most burst errors of larger than k bits can also be detected.) CRC’s of different complexity are parts of standardized protocols and are usu-ally provided internally to the NIC and implemented in LSI circuitry by the vendor. Six common polynomials are shown in Table. 2.5 on pg. 101 The actual implementation of CRC algorithms is discussed briefly in the text but is beyond the scope of this class. Theoretically ( pg 100 shaded box ) it is possible to send enough redundant data to allow detection and correction of bit errors. In most cases at reasonable error rates it is more efficient to simply discard error packets and recover them by retransmission. In applications such as recovery of data from a distant site with a long RTT (intra or inter stellar for example) redundant bits are increased, sometime even more than 100%, to greatly improve correction accuracy. Chapter 2 —Getting Connected
52
Cyclic Redundancy Check (CRC)
IFSC3315-Applied Networking Spring 2012 Cyclic Redundancy Check (CRC) Six generator polynomials that have become international standards are: CRC-8 = x8+x2+x+1 CRC-10 = x10+x9+x5+x4+x+1 CRC-12 = x12+x11+x3+x2+x+1 CRC-16 = x16+x15+x2+1 CRC-CCITT = x16+x12+x5+1 CRC-32 = x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1 As detailed on pg. 102, the standard polynomials detect all single bit errors, all double bit errors, all odd numbers of errors, all burst errors shorter than the order of the polynomial, and most longer burst errors. As microprocessor chip-sets became more common it was usual for all of these CRC formulas to be available in the LSI device. A register would be set during the driver initialization to select the CRC formula. It is required, obviously, for both ends of a connection to use the same CRC formula. Chapter 2 —Getting Connected
53
Reliable Transmission
IFSC3315-Applied Networking Spring 2012 Reliable Transmission CRC is used to detect errors. Some error codes are strong enough to correct errors. The overhead is typically too high. Corrupt frames must be discarded. A link-level protocol that wants to deliver frames reliably must recover from these discarded frames. This is accomplished using a combination of two fundamental mechanisms Acknowledgements and Timeouts In discussing reliable transmission of data the most common method used is to detect errors and request retransmission of packets containing errors. Two simple mechanisms are implemented to allow recovery from common error conditions: Acknowledgement and timeout. The acknowledgment can be either positive (ACK) or negative (NAK) The procedures for implementing reliable delivery is called Automatic Repeat Request (ARQ). An acknowledgement (ACK for short) is a small control frame that a protocol sends back to its peer saying that it has received the earlier frame. A control frame is a frame with header only (no data). The receipt of an acknowledgement indicates to the sender of the original frame that its frame was successfully delivered. Chapter 2 —Getting Connected
54
Reliable Transmission
IFSC3315-Applied Networking Spring 2012 Reliable Transmission If the sender does not receive an acknowledgment after a reasonable amount of time, then it retransmits the original frame. The action of waiting a reasonable amount of time is called a timeout. The general strategy of using acknowledgements and timeouts to implement reliable delivery is sometimes called Automatic Repeat reQuest (ARQ). Chapter 2 —Getting Connected
55
IFSC3315-Applied Networking
Spring 2012 Stop and Wait Protocol Idea of stop-and-wait protocol is straightforward After transmitting one frame, the sender waits for an acknowledgement before transmitting the next frame. If the acknowledgement does not arrive after a certain period of time, the sender times out and retransmits the original frame The simplest form of ARQ procedure is Stop-and-wait. After transmitting a frame the transmitter stops and waits for the receiver to send back an acknowledgement that the packet was correctly received. When sending, the transmitter starts a timer as the packet is sent. If the ACK arrives before the timer has expired another packet may be sent and the timer is reset. Chapter 2 —Getting Connected
56
IFSC3315-Applied Networking
Spring 2012 Stop and Wait Protocol Scenarios a and b illustrate the simple use of this scheme. In a the ACK is received prior to timeout. In b the packet never made it to the receiver and it is resent after the timeout interval. In c and d the packet was received but the ACK is either lost c) or arrives after the timer has expired d). The receiver will think that the retransmitted packet is actually a new packet and will add it to the output!! d) is sometimes referred to as a ‘race’ condition since the ACK lost the race to the timeout timer. A solution is to add a one bit sequence number to both the transmitted packet and the acknowledgment packet. If we sent packet 0 we should get ACK-0 back. When sending packet 1 we should get ACK-1. Since we never send the next packet until the previous packet is acknowledged, two numbers are sufficient to avoid the confusion of c) and d) Timeline showing four different scenarios for the stop-and-wait algorithm. (a) The ACK is received before the timer expires; (b) the original frame is lost; (c) the ACK is lost; (d) the timeout fires too soon Chapter 2 —Getting Connected
57
IFSC3315-Applied Networking
Spring 2012 Stop and Wait Protocol Problem: keeping the pipe full Example 1.5Mbps link x 45ms RTT = 67.5Kb (8KB) 1KB frames imples 1/8th link utilization For short links stop-and-wait may not be a bad choice but look at typical exam-ple where the delay bandwidth product makes stop and wait costly. Ex: RTT=45ms BW=1.5x106bps. Frame = 1KB. Delay x BW = 67.5Kb ~8KB. We will be able to send 1/RTT frames/sec over this link x8/.045=182Kbps or about 1/8 or our actual link capacity. This should illustrate the effect of delay bandwidth on throughput. Because of stop-and-wait and the relatively long RTT we are not ‘keeping the pipe full’ and get throughput << bandwidth. Timeline for stop-and-wait with 1-bit sequence number Chapter 2 —Getting Connected
58
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window To avoid the problems of strict stop-and-wait we use an ARQ scheme dubbed ‘sliding window’. In this scheme some number of frames are allowed to be outstanding ( un-acknowledged ) before we will stop sending data onto the link. The upper bound of the number of un-ACKed frames is called the window. There are elemental compromises necessary to use the sliding window. The sender must buffer all un-ACKed frames in case they are needed for re-transmission. More than one sequence bit is necessary since more than one packet can be ‘in the pipe’ at any given time. These bits are overhead that will be discarded at the receiver. Timeline for Sliding Window Protocol Chapter 2 —Getting Connected
59
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol Assign sequence number to each frame (SeqNum) Maintain three state variables: send window size (SWS) last acknowledgment received (LAR) last frame sent (LFS) Maintain invariant: LFS - LAR <= SWS SWS LAR LFS … Three state variables are used to implement the sliding window scheme. At the transmitter, send window size (SWS) determines the number of frames that can be outstanding and also the number of bits needed as overhead. For example if SWS = 7 then three bits will be the minimum. As we will see later, if three bits are used then SWS should be three. The LAR is set to the sequence number received in the last ACK-n packet received from the far end. The LFS is set to the sequence number of the last frame sent. LFS-LAR≤SWS Advance LAR when ACK arrives Buffer up to SWS frames Sliding Window on Sender Chapter 2 —Getting Connected
60
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol Maintain three state variables receive window size (RWS) largest frame acceptable (LFA) last frame received (NFE) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: if LFR < SeqNum < = LFA accept if SeqNum < = LFR or SeqNum > LFA discarded Send cumulative ACKs At the receiver, RWS is analogous to SWS and should be the same. This parameter may be set by the protocol or negotiated at the beginning of the conversation (session setup). At the receiver I have LFR set to the sequence number of the last frame correctly received. I should get a packet with a seq-uence number 1 greater than LFR. If LFR was 7 in our 3 bit example then the next sequence number would be 0. ( rollover with no carry ) The book is illustrating a more general implementation where out of order packets can be received. It allows sequence numbers to increase to simplify the example. The LAF is the largest frame sequence number that is acceptable (again using rollover without carry) and is based on the number of sequence numbers being used. In the book example(pg. 108), SWS = RWS = 4 and packet #6 is missing or arrives with an error. Assume we had correctly received and acknowledged packet #5 (LAR=5) . Packets 7 and 8 are in the pipe and are correctly received and buffered since LAF-LFR≤RWS. No ACK is sent since packet 6 is missing. After the transmitter has sent frame 9 it will stop since LFS – LAR = SWS. After a timeout frame 6 will be sent. The receiver can now send ACK 8 since it has 7 and 8 already buffered. When the sender gets the ACK 8 it will move its window and send frame 9. The error has caused a large gap in the utilization of the link. If we add the complexity of out order acknowledgment or of negative acknowledgments (NAK) we can minimize lost capacity in the presence of errors Sliding Window on Receiver Chapter 2 —Getting Connected
61
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol When a frame with sequence number SeqNum arrives, what does the receiver do? If SeqNum ≤ LFR or SeqNum > LAF Discard it (the frame is outside the receiver window) If LFR < SeqNum ≤ LAF Accept it Now the receiver needs to decide whether or not to send an ACK Chapter 2 —Getting Connected
62
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol Let SeqNumToAck Denote the largest sequence number not yet acknowledged, such that all frames with sequence number less than or equal to SeqNumToAck have been received The receiver acknowledges the receipt of SeqNumToAck even if high-numbered packets have been received This acknowledgement is said to be cumulative. The receiver then sets LFR = SeqNumToAck and adjusts LAF = LFR + RWS Chapter 2 —Getting Connected
63
Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Sliding Window Protocol For example, suppose LFR = 5 and RWS = 4 (i.e. the last ACK that the receiver sent was for seq. no. 5) LAF = 9 If frames 7 and 8 arrive, they will be buffered because they are within the receiver window But no ACK will be sent since frame 6 is yet to arrive Frames 7 and 8 are out of order Frame 6 arrives (it is late because it was lost first time and had to be retransmitted) Now Receiver Acknowledges Frame 8 and bumps LFR to 8 and LAF to 12 Chapter 2 —Getting Connected
64
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol When timeout occurs, the amount of data in transit decreases Since the sender is unable to advance its window When the packet loss occurs, this scheme is no longer keeping the pipe full The longer it takes to notice that a packet loss has occurred, the more severe the problem becomes How to improve this Negative Acknowledgement (NAK) Additional Acknowledgement Selective Acknowledgement Chapter 2 —Getting Connected
65
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol Negative Acknowledgement (NAK) Receiver sends NAK for frame 6 when frame 7 arrive (in the previous example) However this is unnecessary since sender’s timeout mechanism will be sufficient to catch the situation Additional Acknowledgement Receiver sends additional ACK for frame 5 when frame 7 arrives Sender uses duplicate ACK as a clue for frame loss Selective Acknowledgement Receiver will acknowledge exactly those frames it has received, rather than the highest number frames Receiver will acknowledge frames 7 and 8 Sender knows frame 6 is lost Sender can keep the pipe full (additional complexity) Chapter 2 —Getting Connected
66
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol How to select the window size SWS is easy to compute Delay Bandwidth RWS can be anything Two common setting RWS = 1 No buffer at the receiver for frames that arrive out of order RWS = SWS The receiver can buffer frames that the sender transmits It does not make any sense to keep RWS > SWS WHY? Chapter 2 —Getting Connected
67
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol Finite Sequence Number Frame sequence number is specified in the header field Finite size 3 bit: eight possible sequence number: 0, 1, 2, 3, 4, 5, 6, 7 It is necessary to wrap around Chapter 2 —Getting Connected
68
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol How to distinguish between different incarnations of the same sequence number? Number of possible sequence number must be larger than the number of outstanding frames allowed Stop and Wait: One outstanding frame 2 distinct sequence number (0 and 1) Let MaxSeqNum be the number of available sequence numbers SWS + 1 ≤ MaxSeqNum Is this sufficient? Chapter 2 —Getting Connected
69
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol SWS + 1 ≤ MaxSeqNum Is this sufficient? Depends on RWS If RWS = 1, then sufficient If RWS = SWS, then not good enough For example, we have eight sequence numbers 0, 1, 2, 3, 4, 5, 6, 7 RWS = SWS = 7 Sender sends 0, 1, …, 6 Receiver receives 0, 1, … ,6 Receiver acknowledges 0, 1, …, 6 ACK (0, 1, …, 6) are lost Sender retransmits 0, 1, …, 6 Receiver is expecting 7, 0, …., 5 Chapter 2 —Getting Connected
70
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol To avoid this, If RWS = SWS SWS < (MaxSeqNum + 1)/2 Chapter 2 —Getting Connected
71
Issues with Sliding Window Protocol
IFSC3315-Applied Networking Spring 2012 Issues with Sliding Window Protocol Serves three different roles Reliable Preserve the order Each frame has a sequence number The receiver makes sure that it does not pass a frame up to the next higher-level protocol until it has already passed up all frames with a smaller sequence number Frame control Receiver is able to throttle the sender Keeps the sender from overrunning the receiver From transmitting more data than the receiver is able to process “One important concept to take away from this discussion is the system design principle we call separation of concerns. That is, you must be careful to distinguish between different functions that are sometimes rolled together in one mechanism, and you must make sure that each function is necessary and being supported in the most effective way. In this particular case, reliable delivery, ordered delivery, and flow control are sometimes combined in a single sliding window protocol, and we should ask ourselves is this is the right thing to do at the link level. With this question in mind, we revisit the sliding window algorithm in Chapter 3 (X.25 uses it to implement hop-to-hop flow control) and Chapter 5(TCP uses it to implement a reliable byte-stream channel) Concurrent Logical Channels Look over section in the text Chapter 2 —Getting Connected
72
IFSC3315-Applied Networking
Ethernet Spring 2012 Most successful local area networking technology of last 20 years. Developed in the mid-1970s by researchers at the Xerox Palo Alto Research Centers (PARC). Uses CSMA/CD technology Carrier Sense Multiple Access with Collision Detection. A set of nodes send and receive frames over a shared link. Carrier sense means that all nodes can distinguish between an idle and a busy link. Collision detection means that a node listens as it transmits and can therefore detect when a frame it is transmitting has collided with a frame transmitted by another node. One of the characteristics of a ‘shared’ access network is that the media used to transfer the data distributes the data uniformly over its ‘area’ with no decision making limiting where data is sent. By this we mean that every station on a shared ‘segment’ will see all of the data on that segment, not a subset of it. The individual NIC’s are responsible for selecting to receive or ignore each frame. I used to use a telephone party line as an example but it is unlikely that current students will have experienced this configuration. A more current example may be a room with many people, some involved in private conversations. A person enters the room and calls out the name of someone in the room. Only that person will ‘interrupt’ what they are doing and pay attention to the caller. We will examine in the later chapters how these segments are connected toge-ther but for this part of the subject ‘shared’ means visible to all. All stations can view all the data on the segment but the converse is that, for this to work, only one station can be transmitting at a given interval. The Multiple Access Control (MAC) method is what normally defines what type of network is defined. Chapter 2 —Getting Connected
73
IFSC3315-Applied Networking
Ethernet Spring 2012 Uses ALOHA (packet radio network) as the root protocol Developed at the University of Hawaii to support communication across the Hawaiian Islands. For ALOHA the medium was atmosphere, for Ethernet the medium is a coax cable. DEC and Intel joined Xerox to define a 10-Mbps Ethernet standard in 1978. This standard formed the basis for IEEE standard 802.3 More recently has been extended to include a 100-Mbps version called Fast Ethernet and a 1000-Mbps version called Gigabit Ethernet. Developed as part of a computer and terminal networking project at the Xerox Palo Alto Research Center. Tri-company agreement in Basis of IEEE standard. The multiple access method, CSMA/CD, allows simple connection equipment with few rules. Routinely implemented in LSI. Chapter 2 —Getting Connected
74
IFSC3315-Applied Networking
Ethernet Spring 2012 An Ethernet segment is implemented on a coaxial cable of up to 500 m. This cable is similar to the type used for cable TV except that it typically has an impedance of 50 ohms instead of cable TV’s 75 ohms. Hosts connect to an Ethernet segment by tapping into it. A transceiver (a small device directly attached to the tap) detects when the line is idle and drives signal when the host is transmitting. The transceiver also receives incoming signal. The transceiver is connected to an Ethernet adaptor which is plugged into the host. The protocol is implemented on the adaptor. Ethernet uses a ‘shared’ media concept. In coax wiring the cable snaked through the building and floors, possibly using repeaters. The transceiver would physically connect to the cable (tap) and the transceiver would be wired to the NIC at the host using a multi-pair (AUI) cable Chapter 2 —Getting Connected
75
IFSC3315-Applied Networking
Ethernet Spring 2012 Ethernet transceiver and adaptor Chapter 2 —Getting Connected
76
IFSC3315-Applied Networking
Ethernet Spring 2012 Multiple Ethernet segments can be joined together by repeaters. A repeater is a device that forwards digital signals. No more than four repeaters may be positioned between any pair of hosts. An Ethernet has a total reach of only 2500 m. Total length of 5 x 500 Meter segments with 4 repeaters is 2500 meters Chapter 2 —Getting Connected
77
IFSC3315-Applied Networking
Ethernet Spring 2012 Ethernet repeater Chapter 2 —Getting Connected
78
IFSC3315-Applied Networking
Ethernet Spring 2012 Any signal placed on the Ethernet by a host is broadcast over the entire network Signal is propagated in both directions. Repeaters forward the signal on all outgoing segments. Terminators attached to the end of each segment absorb the signal. Ethernet uses Manchester encoding scheme. Chapter 2 —Getting Connected
79
IFSC3315-Applied Networking
Ethernet Spring 2012 New Technologies in Ethernet Instead of using coax cable, an Ethernet can be constructed from a thinner cable known as 10Base2 (the original was 10Base5) 10 means the network operates at 10 Mbps Base means the cable is used in a baseband system 2 means that a given segment can be no longer than 200 m Similar to Ethernet but for smaller spans. Chapter 2 —Getting Connected
80
IFSC3315-Applied Networking
Ethernet Spring 2012 New Technologies in Ethernet Another cable technology is 10BaseT T stands for twisted pair Limited to 100 m in length With 10BaseT, the common configuration is to have several point to point segments coming out of a multiway repeater, called Hub . For twisted pairs the wiring would converge at a ‘hub’ and have a star like radiation of cables from the hubs to the hosts. The hub had one receiver monitoring all the connected transmitters and one transmitter connected to all the receivers. An early Ethernet offering by AT&T was trademarked Starlan™ Chapter 2 —Getting Connected
81
IFSC3315-Applied Networking
Ethernet Spring 2012 Ethernet Hub Chapter 2 —Getting Connected
82
Access Protocol for Ethernet
IFSC3315-Applied Networking Access Protocol for Ethernet Spring 2012 The algorithm is commonly called Ethernet’s Media Access Control (MAC). It is implemented in Hardware on the network adaptor. Frame format Preamble (64bit): allows the receiver to synchronize with the signal (sequence of alternating 0s and 1s). Host and Destination Address (48bit each). Packet type (16bit): acts as demux key to identify the higher level protocol. Data (up to 1500 bytes) Minimally a frame must contain at least 46 bytes of data. Frame must be long enough to detect collision. CRC (32bit) The 64 bit preamble of alternate 1’s and 0’s serves to allow receiver synchro-nization. The NIC address is encoded in ROM. The sending of the destination address first allows receiving NIC’s to quickly determine if the packet is for them or not. If not the adapter resets, waiting for the next preamble. Also used in bridge/switch technology, the destination being first allows for quick decision making on whether or not to forward a packet it senses on an interface. Packet type defines the rest of the packet. In the standard the 16 bits of the type field became a length field and the type field is moved to the head of the ‘body’ segment. Chapter 2 —Getting Connected
83
IFSC3315-Applied Networking
Ethernet Frame Spring 2012 The destination address is examined by the receiver in each NIC to decide if the packet should be acted on (copied into the receive buffer and passed to the host) or ignored. If the destination address does not match the NIC address the packet is discarded. If the destination address is all 1’s the packet is a broadcast and is copied in by all NIC’s. If the multicast bit is set the rest of the address is comp-pared to a list of addresses in the NIC pre-configured if this NIC is to receive multicast. If the multicast address matches the packet is copied into the buffer. Encoding is Manchester and bit rates of 10Mbps, 100Mbps, and 1000Mbps are supported. Length for the 10 Mbps thick Ethernet (10BASE5) is 500 meters per segment with 5 segments maximum. For thin Ethernet (10BASE2) the segment length is 200m. For 100 MBps Ethernet (Fast Ethernet) and 1000Mbps Ethernet (Gigabit Ethernet) the segment length is 100m for CAT 5 twisted pair and 250m and 2Km for multi mode fiber and single mode fiber, respectively. Fast and Gigabit Ethernet are designed for full duplex links and are usually implemented in bridge/switched networks, described in the next chapter. Ethernet is a half duplex protocol and therefore requires some distributed algorithm, CSMA/CD, to control access to the media (MAC protocol). Ethernet Frame Format Chapter 2 —Getting Connected
84
IFSC3315-Applied Networking
Ethernet Addresses Spring 2012 Each host on an Ethernet (in fact, every Ethernet host in the world) has a unique Ethernet Address. The address belongs to the adaptor, not the host. It is usually burnt into ROM. Ethernet addresses are typically printed in a human readable format As a sequence of six numbers separated by colons. Each number corresponds to 1 byte of the 6 byte address and is given by a pair of hexadecimal digits, one for each of the 4-bit nibbles in the byte Leading 0s are dropped. For example, 8:0:2b:e4:b1:2 is Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
85
IFSC3315-Applied Networking
Ethernet Addresses Spring 2012 To ensure that every adaptor gets a unique address, each manufacturer of Ethernet devices is allocated a different prefix that must be prepended to the address on every adaptor they build AMD has been assigned the 24bit prefix 8:0:20 Chapter 2 —Getting Connected
86
IFSC3315-Applied Networking
Ethernet Addresses Spring 2012 Each frame transmitted on an Ethernet is received by every adaptor connected to that Ethernet. Each adaptor recognizes those frames addressed to its address and passes only those frames on to the host. In addition, to unicast address, an Ethernet address consisting of all 1s is treated as a broadcast address. All adaptors pass frames addressed to the broadcast address up to the host. Similarly, an address that has the first bit set to 1 but is not the broadcast address is called a multicast address. A given host can program its adaptor to accept some set of multicast addresses. Chapter 2 —Getting Connected
87
IFSC3315-Applied Networking
Ethernet Addresses Spring 2012 To summarize, an Ethernet adaptor receives all frames and accepts Frames addressed to its own address Frames addressed to the broadcast address Frames addressed to a multicast addressed if it has been instructed Chapter 2 —Getting Connected
88
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm When the adaptor has a frame to send and the line is idle, it transmits the frame immediately. The upper bound of 1500 bytes in the message means that the adaptor can occupy the line for a fixed length of time. When the 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 an adaptor with a frame to send transmits with probability 1 whenever a busy line goes idle. The CS in the MAC name means ‘carrier sense’. When a packet is present to be sent and the receiver does not sense that carrier (data) is present the transmitter is immediately activated to place the packet on the line. Min packet data length is 38 bytes for a total length of 512 bits (51.2 μs) Padding is used to reach this length. Max packet data length is 1500 bytes for a total length of bits. ( μs) Upper bound on packet length limits effect of large data source on small data sources. (Approximately 800 (minimum) opportunities per second to transmit. The MA in the MAC name means ‘multiple access’. If the receiver senses carrier when ready to transmit it waits until carrier goes away μs later it starts to transmit its packet. Chapter 2 —Getting Connected
89
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Since there is no centralized control it is possible for two (or more) adaptors to begin transmitting at the same time, Either because both found the line to be idle, Or, both had been waiting for a busy line to become idle. When this happens, the two (or more) frames are said to be collide on the network. Chapter 2 —Getting Connected
90
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Since Ethernet supports collision detection, each sender is able to determine that a collision is in progress. At the moment an adaptor detects that its frame is colliding with another, it first makes sure to transmit a 32-bit jamming sequence and then stops transmission. Thus, a transmitter will minimally send 96 bits in the case of collision 64-bit preamble + 32-bit jamming sequence Chapter 2 —Getting Connected
91
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm One way that an adaptor will send only 96 bit (called a runt frame) is if the two hosts are close to each other. Had they been farther apart, They would have had to transmit longer, and thus send more bits, before detecting the collision. Chapter 2 —Getting Connected
92
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm The worst case scenario happens when the two hosts are at opposite ends of the Ethernet. To know for sure that the frame its just sent did not collide with another frame, the transmitter may need to send as many as 512 bits. Every Ethernet frame must be at least 512 bits (64 bytes) long. 14 bytes of header + 46 bytes of data + 4 bytes of CRC Chapter 2 —Getting Connected
93
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Why 512 bits? Why is its length limited to 2500 m? The farther apart two nodes are, the longer it takes for a frame sent by one to reach the other, and the network is vulnerable to collision during this time Chapter 2 —Getting Connected
94
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm A begins transmitting a frame at time t d denotes the one link latency The first bit of A’s frame arrives at B at time t + d Suppose an instant before host A’s frame arrives, host B begins to transmit its own frame B’s frame will immediately collide with A’s frame and this collision will be detected by host B Host B will send the 32-bit jamming sequence Host A will not know that the collision occurred until B’s frame reaches it, which will happen at t + 2 * d Host A must continue to transmit until this time in order to detect the collision Host A must transmit for 2 * d to be sure that it detects all possible collisions Chapter 2 —Getting Connected
95
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Examining the mechanism of CSMA/CD we will show the reasoning behind the related choices of segment length and minimum frame sizes. In the top scenario, A has detected a clear line and sent a frame. After an interval the header of the frame arrives at B and B will no longer attempt to transmit during the frame. If, as in the third scenario, B has sensed a clear link and begins to generate a frame just before the header of A’s frame has arrived. In this scenario, the link is so long that A has taken it’s transmitter off the line and will be unable to sense a collision. B will sense the collision and transmit a ‘jam’ sequence. Station C (assume it is midway between A and B) will have correctly received A’s packet and may act on it. It has no way of associating the ‘jam’ sequence with A’s packet. Station D, further to the right from B, will not get A’s packet due to the ‘jam’ sequence placed by B. This illustrates the conflicting choices involved in choosing line parameters. The 2500 m max. length ( and the other lengths for different speeds and media ) are based on the max RTT that will be shorter than the min. frame length. If the link length above were short enough that A was still transmitting the frame when the header from B, sent just before A’s header reached B, arrives at A. Both A and B would then be able to detect the collision for minimum length frames. The maximum link distance is then determined by the relation between RTT and the chosen minimum packet size. For Ethernet this time is 51.2 μs and corresponds to a round trip of meters of 50 ohm thick coax. The corresponding interval for Fast ethernet is 5.12 μs. This distance is called the collision diameter Worst-case scenario: (a) A sends a frame at time t; (b) A’s frame arrives at B at time t + d; (c) B begins transmitting at time t + d and collides with A’s frame; (d) B’s runt (32-bit) frame arrives at A at time t + 2d. Chapter 2 —Getting Connected
96
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Consider that a maximally configured Ethernet is 2500 m long, and there may be up to four repeaters between any two hosts, the round trip delay has been determined to be 51.2 s Which on 10 Mbps Ethernet corresponds to 512 bits The other way to look at this situation, We need to limit the Ethernet’s maximum latency to a fairly small value (51.2 s) for the access algorithm to work Hence the maximum length for the Ethernet is on the order of 2500 m. Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
97
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm Once an adaptor has detected a collision, and stopped its transmission, it waits a certain amount of time and tries again. Each time the adaptor tries to transmit but fails, it doubles the amount of time it waits before trying again. This strategy of doubling the delay interval between each retransmission attempt is known as Exponential Backoff. While transmitting the receiver monitors the line. If a second transmitter starts transmitting while the NIC is still transmitting, the voltage level at the receiver will change and be detected as a ‘collision’. This is the CD in the MAC name. A ‘jam’ sequence will be transmitted and a randomized algorithm is used to decide when to try again. Chapter 2 —Getting Connected
98
Ethernet Transmitter Algorithm
IFSC3315-Applied Networking Spring 2012 Ethernet Transmitter Algorithm The adaptor first delays either 0 or 51.2 s, selected at random. If this effort fails, it then waits 0, 51.2, 102.4, s (selected randomly) before trying again; This is k * 51.2 for k = 0, 1, 2, 3 After the third collision, it waits k * 51.2 for k = 0…23 – 1 (again selected at random). In general, the algorithm randomly selects a k between 0 and 2n – 1 and waits for k * 51.2 s, where n is the number of collisions experienced so far. The first collision will cause a random selection of either 0 or 51.2 μs. If this resolves the collision the counter is reset. If there is a second collision, the random selection will be 0, 51.2 μs, or μs…. Until 10 collisions when the selections are not increased. After a configurable number of successive collisions (default 16) the transmitter will give up and report the failure to the next layer of the protocol stack. All stations that share the same media, including those connected by repeaters, are said to be in the same ‘collision domain’ since each transmission by one station is heard by all the others. Chapter 2 —Getting Connected
99
Experience with Ethernet
IFSC3315-Applied Networking Spring 2012 Experience with Ethernet Ethernets work best under lightly loaded conditions. Under heavy loads, too much of the network’s capacity is wasted by collisions. Most Ethernets are used in a conservative way. Have fewer than 200 hosts connected to them which is far fewer than the maximum of 1024. Most Ethernets are far shorter than 2500m with a round-trip delay of closer to 5 s than 51.2 s. Ethernets are easy to administer and maintain. There are no switches that can fail and no routing and configuration tables that have to be kept up-to-date. It is easy to add a new host to the network. It is inexpensive. Cable is cheap, and only other cost is the network adaptor on each host. Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
100
IFSC3315-Applied Networking
Spring 2012 Wireless Links Wireless links transmit electromagnetic signals Radio, microwave, infrared Wireless links all share the same “wire” (so to speak) The challenge is to share it efficiently without unduly interfering with each other Most of this sharing is accomplished by dividing the “wire” along the dimensions of frequency and space Exclusive use of a particular frequency in a particular geographic area may be allocated to an individual entity such as a corporation Chapter 2 —Getting Connected
101
IFSC3315-Applied Networking
Spring 2012 Wireless Links These allocations are determined by government agencies such as FCC (Federal Communications Commission) in USA Specific bands (frequency) ranges are allocated to certain uses. Some bands are reserved for government use Other bands are reserved for uses such as AM radio, FM radio, televisions, satellite communications, and cell phones Specific frequencies within these bands are then allocated to individual organizations for use within certain geographical areas. Finally, there are several frequency bands set aside for “license exempt” usage Bands in which a license is not needed Chapter 2 —Getting Connected
102
IFSC3315-Applied Networking
Spring 2012 Wireless Links Devices that use license-exempt frequencies are still subject to certain restrictions The first is a limit on transmission power This limits the range of signal, making it less likely to interfere with another signal For example, a cordless phone might have a range of about 100 feet. Chapter 2 —Getting Connected
103
IFSC3315-Applied Networking
Spring 2012 Wireless Links The second restriction requires the use of Spread Spectrum technique Idea is to spread the signal over a wider frequency band So as to minimize the impact of interference from other devices Originally designed for military use Frequency hopping Transmitting signal over a random sequence of frequencies First transmitting at one frequency, then a second, then a third… The sequence of frequencies is not truly random, instead computed algorithmically by a pseudorandom number generator The receiver uses the same algorithm as the sender, initializes it with the same seed, and is Able to hop frequencies in sync with the transmitter to correctly receive the frame Spread spectrum was originally a military radio technology designed to thwart jamming which typically would block specific frequencies and be foiled by the rapidly ‘hopping’ carrier. The LSI devices in the radio interface cards control and synchronize the various sequences to allow cards to connect to each other and rejects signals from other adjacent transmitters. Chapter 2 —Getting Connected
104
IFSC3315-Applied Networking
Spring 2012 Wireless Links A second spread spectrum technique called Direct sequence Represents each bit in the frame by multiple bits in the transmitted signal. For each bit the sender wants to transmit It actually sends the exclusive OR of that bit and n random bits The sequence of random bits is generated by a pseudorandom number generator known to both the sender and the receiver. The transmitted values, known as an n-bit chipping code, spread the signal across a frequency band that is n times wider Chapter 2 —Getting Connected
105
IFSC3315-Applied Networking
Spring 2012 Wireless Links Example 4-bit chipping sequence Chapter 2 —Getting Connected
106
IFSC3315-Applied Networking
Spring 2012 Wireless Links Wireless technologies differ in a variety of dimensions How much bandwidth they provide How far apart the communication nodes can be Four prominent wireless technologies Bluetooth Wi-Fi (more formally known as ) WiMAX (802.16) 3G cellular wireless Chapter 2 —Getting Connected
107
IFSC3315-Applied Networking
Spring 2012 Wireless Links Overview of leading wireless technologies Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
108
IFSC3315-Applied Networking
Spring 2012 Wireless Links Mostly widely used wireless links today are usually asymmetric Two end-points are usually different kinds of nodes One end-point usually has no mobility, but has wired connection to the Internet (known as base station) The node at the other end of the link is often mobile Chapter 2 —Getting Connected
109
IFSC3315-Applied Networking
Spring 2012 Wireless Links A wireless network using a base station Chapter 2 —Getting Connected
110
IFSC3315-Applied Networking
Spring 2012 Wireless Links Wireless communication supports point-to-multipoint communication Communication between non-base (client) nodes is routed via the base station Three levels of mobility for clients No mobility: the receiver must be in a fix location to receive a directional transmission from the base station (initial version of WiMAX) Mobility is within the range of a base (Bluetooth) Mobility between bases (Cell phones and Wi-Fi) Chapter 2 —Getting Connected
111
IFSC3315-Applied Networking
Spring 2012 Wireless Links Mesh or Ad-hoc network Nodes are peers Messages may be forwarded via a chain of peer nodes A wireless ad-hoc or mesh network Chapter 2 —Getting Connected
112
IFSC3315-Applied Networking
Spring 2012 IEEE Also known as Wi-Fi Like its Ethernet and token ring siblings, is designed for use in a limited geographical area (homes, office buildings, campuses) Primary challenge is to mediate access to a shared communication medium – in this case, signals propagating through space supports additional features power management and security mechanisms Chapter 2 —Getting Connected
113
IFSC3315-Applied Networking
Spring 2012 IEEE Original standard defined two radio-based physical layer standard One using the frequency hopping Over 79 1-MHz-wide frequency bandwidths Second using direct sequence Using 11-bit chipping sequence Both standards run in the 2.4-GHz and provide up to 2 Mbps Then physical layer standard b was added Using a variant of direct sequence b provides up to 11 Mbps Uses license-exempt 2.4-GHz band Then came a which delivers up to 54 Mbps using OFDM 802.11a runs on license-exempt 5-GHz band Most recent standard is g which is backward compatible with b Uses 2.4 GHz band, OFDM and delivers up to 54 Mbps Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
114
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Consider the situation in the following figure where each of four nodes is able to send and receive signals that reach just the nodes to its immediate left and right For example, B can exchange frames with A and C, but it cannot reach D C can reach B and D but not A Example of a wireless network Chapter 2 —Getting Connected
115
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Suppose both A and C want to communicate with B and so they each send it a frame. A and C are unaware of each other since their signals do not carry that far These two frames collide with each other at B But unlike an Ethernet, neither A nor C is aware of this collision A and C are said to hidden nodes with respect to each other Chapter 2 —Getting Connected
116
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance The “Hidden Node” Problem. Although A and C are hidden from each other, their signals can collide at B. (B’s reach is not shown.) Chapter 2 —Getting Connected
117
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Another problem called exposed node problem occurs Suppose B is sending to A. Node C is aware of this communication because it hears B’s transmission. It would be a mistake for C to conclude that it cannot transmit to anyone just because it can hear B’s transmission. Suppose C wants to transmit to node D. This is not a problem since C’s transmission to D will not interfere with A’s ability to receive from B. Chapter 2 —Getting Connected
118
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Exposed Node Problem. Although B and C are exposed to each other’s signals, there is no interference if B transmits to A while C transmits to D. (A and D’s reaches are not shown.) Chapter 2 —Getting Connected
119
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance addresses these two problems with an algorithm called Multiple Access with Collision Avoidance (MACA). Key Idea Sender and receiver exchange control frames with each other before the sender actually transmits any data. This exchange informs all nearby nodes that a transmission is about to begin Sender transmits a Request to Send (RTS) frame to the receiver. The RTS frame includes a field that indicates how long the sender wants to hold the medium - Length of the data frame to be transmitted Receiver replies with a Clear to Send (CTS) frame This frame echoes this length field back to the sender Chapter 2 —Getting Connected
120
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Any node that sees the CTS frame knows that it is close to the receiver, therefore cannot transmit for the period of time it takes to send a frame of the specified length Any node that sees the RTS frame but not the CTS frame is not close enough to the receiver to interfere with it, and so is free to transmit Chapter 2 —Getting Connected
121
IEEE 802.11 – Collision Avoidance
IFSC3315-Applied Networking Spring 2012 IEEE – Collision Avoidance Using ACK in MACA Proposed in MACAW: MACA for Wireless LANs Receiver sends an ACK to the sender after successfully receiving a frame All nodes must wait for this ACK before trying to transmit If two or more nodes detect an idle link and try to transmit an RTS frame at the same time Their RTS frame will collide with each other does not support collision detection So the senders realize the collision has happened when they do not receive the CTS frame after a period of time In this case, they each wait a random amount of time before trying again. The amount of time a given node delays is defined by the same exponential backoff algorithm used on the Ethernet. Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
122
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System is suitable for an ad-hoc configuration of nodes that may or may not be able to communicate with all other nodes. Nodes are free to move around The set of directly reachable nodes may change over time To deal with this mobility and partial connectivity, defines additional structures on a set of nodes Instead of all nodes being created equal, some nodes are allowed to roam some are connected to a wired network infrastructure - they are called Access Points (AP) and they are connected to each other by a so-called distribution system Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
123
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System Following figure illustrates a distribution system that connects three access points, each of which services the nodes in the same region Each of these regions is analogous to a cell in a cellular phone system with the APIs playing the same role as a base station The distribution network runs at layer 2 of the ISO architecture In order to support mobility, where a wireless host can move about beyond the coverage of a single stationary host connected to the main network, a distrib-ution system is assembled using wireless interface equipped devices called access points(AP’s). The access points also have NIC’s connected to a network segment such that the AP’s can communicate with each other about which AP is talking to which mobile host. Each AP will register its connected mobile stations so that if A wanted to talk to F, AP’s 1 and 3 would cooperate to exchange the packets. The most normal usage of this configuration is not for mobile to mobile connections but for mobile to server connections. In this case the AP’s maintain a forwarding table to catch packets for stations on their ‘net’ and to act as the gateway for those stations to access the main network. Access points connected to a distribution network Chapter 2 —Getting Connected
124
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System Although two nodes can communicate directly with each other if they are within reach of each other, the idea behind this configuration is Each nodes associates itself with one access point For node A to communicate with node E, A first sends a frame to its AP-1 which forwards the frame across the distribution system to AP-3, which finally transmits the frame to E When turned on, a mobile host will receive ‘beacons’ from AP’s in range (pass-ive) or will send probe frames(active) and will negotiate a connection to an AP. When a mobile wanders to an area where another AP would be more appropriate than the one now serving it a ‘handoff’ is executed and the new AP now takes over connectivity for the mobile station Access points connected to a distribution network Chapter 2 —Getting Connected
125
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System How do the nodes select their access points How does it work when nodes move from one cell to another The technique for selecting an AP is called scanning The node sends a Probe frame All APs within reach reply with a Probe Response frame The node selects one of the access points and sends that AP an Association Request frame The AP replies with an Association Response frame A node engages this protocol whenever it joins the network, as well as when it becomes unhappy with its current AP This might happen, for example, because the signal from its current AP has weakened due to the node moving away from it Whenever a node acquires a new AP, the new AP notifies the old AP of the change via the distribution system Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
126
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System Consider the situation shown in the following figure when node C moves from the cell serviced by AP-1 to the cell serviced by AP-2. As it moves, it sends Probe frames, which eventually result in Probe Responses from AP-2. At some point, C prefers AP-2 over AP-1 , and so it associates itself with that access point. This is called active scanning since the node is actively searching for an access point Node Mobility Chapter 2 —Getting Connected
127
IEEE 802.11 – Distribution System
IFSC3315-Applied Networking Spring 2012 IEEE – Distribution System APs also periodically send a Beacon frame that advertises the capabilities of the access point; these include the transmission rate supported by the AP This is called passive scanning A node can change to this AP based on the Beacon frame simply by sending it an Association Request frame back to the access point. Node Mobility Chapter 2 —Getting Connected
128
IFSC3315-Applied Networking
Spring 2012 IEEE – Frame Format Source and Destinations addresses: each 48 bits Data: up to 2312 bytes CRC: 32 bit Control field: 16 bits Contains three subfields (of interest) 6 bit Type field: indicates whether the frame is an RTS or CTS frame or being used by the scanning algorithm A pair of 1 bit fields : called ToDS and FromDS The extra address bytes are used to implement the roaming scheme. If a station is connected to a remote stationary host that address would be in one of the slots. Another of the slots would contain the roaming station’s address (MAC). The other addresses could refer to access points involved in the connection with the ultimate destination Frame Format Chapter 2 —Getting Connected
129
IFSC3315-Applied Networking
Spring 2012 IEEE – Frame Format Frame contains four addresses How these addresses are interpreted depends on the settings of the ToDS and FromDS bits in the frame’s Control field This is to account for the possibility that the frame had to be forwarded across the distribution system which would mean that, the original sender is not necessarily the same as the most recent transmitting node Same is true for the destination address Simplest case When one node is sending directly to another, both the DS bits are 0, Addr1 identifies the target node, and Addr2 identifies the source node Chapter 2 —Getting Connected
130
IFSC3315-Applied Networking
Spring 2012 IEEE – Frame Format Most complex case Both DS bits are set to 1 Indicates that the message went from a wireless node onto the distribution system, and then from the distribution system to another wireless node With both bits set, Addr1 identifies the ultimate destination, Addr2 identifies the immediate sender (the one that forwarded the frame from the distribution system to the ultimate destination) Addr3 identifies the intermediate destination (the one that accepted the frame from a wireless node and forwarded across the distribution system) Addr4 identifies the original source Addr1: E, Addr2: AP-3, Addr3: AP-1, Addr4: A Chapter 2 —Getting Connected
131
IFSC3315-Applied Networking
Spring 2012 Bluetooth Used for very short range communication between mobile phones, PDAs, notebook computers and other personal or peripheral devices Operates in the license-exempt band at 2.45 GHz Has a range of only 10 m Communication devices typically belong to one individual or group Sometimes categorized as Personal Area Network (PAN) Version 2.0 provides speeds up to 2.1 Mbps Power consumption is low Chapter 2 —Getting Connected
132
IFSC3315-Applied Networking
Spring 2012 Bluetooth Bluetooth is specified by an industry consortium called the Bluetooth Special Interest Group It specifies an entire suite of protocols, going beyond the link layer to define application protocols, which it calls profiles, for a range of applications There is a profile for synchronizing a PDA with personal computer Another profile gives a mobile computer access to a wired LAN The basic Bluetooth network configuration is called a piconet Consists of a master device and up to seven slave devices Any communication is between the master and a slave The slaves do not communicate directly with each other A slave can be parked: set to an inactive, low-power state Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 2 —Getting Connected
133
IFSC3315-Applied Networking
Spring 2012 Bluetooth A Bluetooth Piconet Chapter 2 —Getting Connected
134
IFSC3315-Applied Networking
Spring 2012 ZigBee ZigBee is a new technology that competes with Bluetooth Devised by the ZigBee alliance and standardized as IEEE It is designed for situations where the bandwidth requirements are low and power consumption must be very low to give very long battery life It is also intended to be simpler and cheaper than Bluetooth, making it financially feasible to incorporate in cheaper devices such as a wall switch that wirelessly communicates with a ceiling-mounted fan Chapter 2 —Getting Connected
135
IFSC3315-Applied Networking
Spring 2012 Summary We introduced the many and varied type of links that are used to connect users to existing networks, and to construct large networks from scratch. We looked at the five key issues that must be addressed so that two or more nodes connected by some medium can exchange messages with each other Encoding Framing Error Detecting Reliability Multiple Access Links Ethernet Wireless , Bluetooth Chapter 2 —Getting Connected
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.