Subscribe by Email


Showing posts with label Data Link layer. Show all posts
Showing posts with label Data Link layer. Show all posts

Friday, July 12, 2013

Sliding Window Protocols? – Part 1

- There are many types of data transmission protocols of which one type is the packet based data transmission protocols. 
- These protocols have a feature called the sliding window protocol.
- The sliding window protocols are a great help wherever the in-order delivery of the data packets demand reliability. 
- For example, the Data link layer of the TCP (transmission control protocol) model and OSI model demand such reliability and thus use window sliding protocol. 
- According to the concept of the sliding window protocols, a consecutive number which is unique is assigned to each and every portion of the transmission i.e., the packets.
- These numbers are used by the receiver for placing the packets it will receive in their correct order. 
- Also, with the help of these numbers, the missing packets can be identified and the duplicate packets can be removed. 
- One problem regarding the sliding window protocols is that it has kept no limits for the size of these numbers that are required. 

- An unlimited number of data packets can be allowed to be communicated at any instant of time if limits are placed on the number of packets involved in transmission or reception. 
- By this, we mean using the sequence numbers of fixed size. 
- By term window we refer to the transmission side. 
- It actually represents the logical boundary or limit of the number of packets that the receiver has to acknowledge. 
- The transmitter has to be informed by the receiver for each ACK (acknowledgement) packet regarding the maximum size or the window boundary of the current receiver buffer. 
- For reporting the window size of the received buffer, a 16 bit field is used in the TCP header. 
- The maximum limit or boundary of the window that we can have is 216 i.e., 64 KB. 
- When operating in the slow start mode, the counting of the transmitter begins with a low packet count.
- Gradually, the number of packets involved increases in every transmission after the ACK packet has been received. 
- Whenever it receives an ACK packet, the window slides logically by one packet for the transmission of a new packet. 
- On reaching the window threshold, one packet is sent by the transmitter for every one packet of ACK received. 
- Suppose the limit of the window is 10 packets and the transmitter is in slow start mode. 
- Then, first one packet will be transmitted followed by another two. 
- Between these two transmissions, it will send an ACK packet also. 
- This process will continue until the limit of 10 has reached. 
- After crossing the limit, the transmission is restricted to one i.e., for every ACK packet received only one data packet is transmitted. 
- When viewed during simulation, it seems as if the window is shifting by distance of one packet whenever an ACK packet is received. 
- For avoiding the traffic congestion, the sliding window protocol works up a great deal.
- In this way the application layer would not have to worry about transmission the next set of data packets. 
- It can continue to do so since the sliding windows of the packet buffer will be implemented on both the sides i.e., the receiver’s and the sender’s side by the TCP. 
-However, the network traffic influences the window size dynamically to a great extent. 
- In order to achieve the highest possible throughput, care should be taken for not forcing the transmitter to stop the transmission before one RTT or round trip delay time by the sliding window protocol. 
- The bandwidth delay product of the links in the communication should be less than the limit of the data amount that can be sent before sending ACK packet. - If this condition is not met, the links’ effective bandwidth will be limited by the protocol. 


Thursday, March 1, 2012

What are different control flow defects?

Flow of control is the dynamic aspect of any program. Whenever there is a flow of control in a program, the program is said to be active or responsive. The execution of a software program, system or application depends pretty much on the flow of control and data. Flow of control is needed to maintain data links between the different components of the software system or application.

The control flow makes use of some predefined special codes. These codes are transmitted via a band over the communications channel preferably primary. These codes are of 2 types namely:


1. XON: it stands for “transmit on” and
2. XOFF: it stands for “transmit off”.

Because of these two codes, the flow of control is sometimes referred to as the “XON/ XOFF control flow”.

NOTE : Flow of control in a software system or application is totally different from the flow of control in the hardware system. Like any other process, the flow of control also experiences some defects.

MECHANISM OF CONTROL FLOW
In order to understand these defects it is necessary that you understand the mechanism of this process.
- One of the ends of the data link sends the code XON to the other end if this end is ready to intake data.
- If this end is not able to receive data it sends off the XOFF code to the other end.
- The other on getting this code immediately stops the data transmission and resumes once again when the other end is ready to accept the data and sends a XON code.

DIFFERENT CONTROL FLOW DEFECTS
- The ends of the data links sometimes become unresponsive to the intake or transmission of data.
- These kinds of problems are an indication of the defects in data linkage.

To make you understand the control flow defects let us see a detailed example:

- Say you connect your computer to printer whose performance speed is relatively slow when compared to the speed of the computer.
- When you want to take out a print, the computer starts by sending the data to be printed to the printer.
- Since the speed of the printer is slower than the computer, it lags behind i.e., it is unable to handle the incoming volume of data from the computer.

- Ultimately it reaches a stage where it memory is overflowing with the data.
- Now what the printer will do in such a situation? It sends a XOFF code to the computer to stop this data transmission.
- It again sends a XON code to the computer once it has received the whole previously transmitted data and is ready to receive the data again.
- XON and XOFF have a specialty that they can be used by the data links in both the directions.
- In some cases it happens that the data links are not able to employ these codes from either direction.
- This is again a defect in the control flow.
- The flow control is usually used for devices having old technology i.e., the devices which are not compatible with the modern software.
- The devices are unable to accept any more incoming data because their output rate is limited.

REMOVAL OF DEFECTS
- Removal of defects in the flow of control is very necessary.
- It is important since the flow of control is very crucial for the well execution of the software system or application.
- Tests should be undertaken to identify these defects.
- Once the defects have been identified, they should be assigned priority on the basis of the severity they can cause.
- The defects should be validated and resolves as soon as possible.


Thursday, March 18, 2010

Serial Line Internet Protocol - SLIP protocol

The need for a data link layer protocol to let IP operate over serial links was identified very early on in the development of TCP/IP. To solve the problem they created a very simple protocol that would frame IP data grams for transmission across the serial line. This protocol is called the Serial Line Internet Protocol, or SLIP for short.
SLIP modifies a standard TCP/IP data gram by appending a special "SLIP END" character to it, which distinguishes data gram boundaries in the byte stream. SLIP requires a serial port configuration of 8 data bits, no parity, and either EIA hardware flow control, or CLOCAL mode (3-wire null-modem) UART operation settings.

- Serial Line Interface Protocol (SLIP) is a TCP/IP protocol used for
communication between two machines that are previously configured for communication with each other.
- The dial-up connection to the server is typically on a slower serial line rather than on the parallel or multiplex lines.
- SLIP does not provide error detection, being reliant on other high-layer protocols for this.
- A SLIP connection needs to have its IP address configuration set each time before it is established.
- The Serial Line Internet Protocol (SLIP) is a mostly obsolete encapsulation of the Internet Protocol designed to work over serial ports and modem connections.
- A version of SLIP with header compression is called CSLIP (Compressed SLIP).
- The Parallel Line Internet Protocol (PLIP) is very similar to SLIP, but works at higher speeds via a parallel port.
- SLIP is a STREAMS-based computer networking facility that provides for the transmission and reception of IP packets over serial lines.
- SLIP can be used to connect one host to another via a single, physical serial line connection between serial ports or over longer distances using a modem at each end of a telephone line.


Wednesday, March 17, 2010

Sliding Window Protocols

These protocols comes under the data link layer.data link layer. It provides services to the network layer. It’s a bidirectional protocol. It means sender deletes the frames when it gets the acknowledgment.

The essence of all sliding window protocols is that at any instant of time, the
sender maintains a set of sequence numbers corresponding to frames it is permitted
to send. These frames are said to fall within the sending window. Similarly,
the receiver also maintains a receiving window corresponding to the set of frames
it is permitted to accept. The sender’s window and the receiver’s window need
not have the same lower and upper limits or even have the same size.

Sliding Window Protocols

The sequence numbers within the sender’s window represent frames that have
been sent or can be sent but are as yet not acknowledged. When new packet from network layer comes in to send, it is given highest no and the upper edge of window is advanced by 1. When the acknowledgment comes in, lower edge of the window is advanced by 1.

Since frames currently within the sender’s window may ultimately be lost or
damaged in transit, the sender must keep all these frames in its memory for possible
retransmission. The receiving data link layer’s window corresponds to the frames it may accept. When a frame whose sequence number is equal to the lower edge of the window is received, it is passed to the network layer, an acknowledgment is generated, and the window is rotated by one.

Types of sliding window protocols


- One-Bit sliding window protocols.
- Go Back N sliding window protocols.
- Selective Repeat sliding window.


Tuesday, March 16, 2010

Concept of Piggybacking

The data link layer provides service to the Network Layer above it:
* The network layer is interested in getting messages to the corresponding network layer module on an adjacent machine.
* The remote Network Layer peer should receive the identical message generated by the sender (e.g., if the data link layer adds control information, the header information must be removed before the message is passed to the Network Layer).
* The Network Layer wants to be sure that all messages it sends, will be delivered correctly (e.g., none lost, no corruption). Note that arbitrary errors may result in the loss of both data and control frames.
* The Network Layer wants messages to be delivered to the remote peer in the exact same order as they are sent.

Interleaving data and control frames on the same circuit is an improvement over having two separate physical circuits, yet another improvement is possible. When a data frame arrives, instead of immediately sending a separate control frame, the receiver restrains itself and waits until the network layer passes it the next packet. The acknowledgment is attached to the outgoing data frame. In effect, the acknowledgment gets a free ride on the next outgoing data frame.

The technique of temporarily delaying outgoing acknowledgments so that they can be hooked onto the next outgoing data frame is known as piggybacking.
Advantage : Better use of available channel bandwidth.
Disadvantage : If the data link layer waits longer than the sender’s timeout period, the frame will be retransmitted, defeating the whole purpose of having acknowledgments.


Monday, March 15, 2010

Concept of Bit stuffing

Bit stuffing is the insertion of one or more bits into a transmission unit as a way to provide signaling information to a receiver. The receiver knows how to detect and remove or disregard the stuffed bits.

Bit stuffing is required by many network and communications protocols for the following reasons:
- To prevent data being interpreted as control information. For example, many frame-based protocols, such as X.25, signal the beginning and end of a frame with six consecutive 1 bits. Therefore, if the actual data being transmitted has six 1 bits in a row, a zero is inserted after the first 5 so that the dat is not interpreted as a frame delimiter. Of course, on the receiving end, the stuffed bits must be discarded.
- For protocols that require a fixed-size frame, bits are sometimes inserted to make the frame size equal to this set size.
- For protocols that required a continuous stream of data, zero bits are sometimes inserted to ensure that the stream is not broken.

Bit stuffing in Data Link layer

Each frame begins and ends with a special bit pattern, 01111110, called a flag byte. When the sender's data link layer encounters five consecutive ones in the data, it automatically stuffs a 0 bit in the outgoing bit stream. When the receiver sees five consecutive 1 bits, followed by 0 bit, it automatically destuffs the 0 bit. Bit stuffing is completely transparent to the network layer.
With bit stuffing, the boundary between two frames can be unambiguously recognized by the flag pattern. If the receiver loses track, all it has to do is scan the input for flag sequences.


Sunday, March 14, 2010

Framing in Data Link Layer

The data link layer detects the number of bits transmitted by physical layer to be error free. The approach used is to break the bit stream up into discrete frames and compute the checksum for each frame. When a frame arrives at the destination, the checksum is recomputed. If this checksum is different from the one obtained in the frame, the data link layer knows that an error has occurred and takes steps to deal with.
There are three different types of framing, each of which provides a way for the sender to tell the receiver where the block of data begins and ends:
- Byte-oriented framing : Computer data is normally stored as alphanumeric characters that are encoded with a combination of 8 bits (1 byte). This type of framing differentiates one byte from another.
- Bit-oriented framing : This type of framing allows the sender to transmit a long string of bits at one time.
- Clock-based framing : In a clock-based system, a series of repetitive pulses are used to maintain a constant bit rate and keep the digital bits aligned in the data stream.

The following methods are commonly used for calculating the check sum :
- Character Count : It uses a field in the header to specify the number of characters in the frame. When data link layer at destination sees the character count, it knows how many characters follow, and hence where the end of frame is. The disadvantage with this method is that the count can be garbled by a transmission error.

- Character stuffing : This method gets around the problem of resynchronization after an error. Each frame starts with the ASCII character sequence DLE(Data Link Escape) STX(Start of Text) and end with the sequence DLE ETX(End of Text). If the destination loses track of frame boundaries, all it has to do is to look for DLE STX or DLE ETX. Problem occurs when binary data such as object programs or floating point numbers are transmitted. Solution to this problem is to have sender's data link layer insert an ASCII DLE character just before each accidental DLE character in the data. The data link layer on receiving end removes the DLE before the data is given to the network layer. This is called character stuffing. A disadvantage of using this framing method is that it is closely tied to 8-bit characters.
-


Saturday, March 13, 2010

Data Link Layer - Layer 2 of OSI model

The Data Link Layer is Layer 2 of the seven-layer OSI model of computer networking.
At this layer, data packets are encoded and decoded into bits. It furnishes transmission protocol knowledge and management and handles errors in the physical layer, flow control and frame synchronization.

The data link layer performs various functions depending upon the hardware protocol used, but has four primary functions:

- Communication with the Network layer above.
- Communication with the Physical layer below.
- Segmentation of upper layer datagrams (also called packets) into frames in sizes that can be handled by the communications hardware.
- The data link layer organizes the pattern of data bits into frames before transmission. The frame formatting issues such as stop and start bits, bit order, parity and other functions are handled here.
- It provides error checking by adding a CRC to the frame, and flow control.
- The data link layer is also responsible for logical link control, media access control, hardware addressing, error detection and handling and defining physical layer standards.
- The data link layer is divided into two sublayers: the media access control (MAC) layer and the logical link control (LLC) layer. The former controls how computers on the network gain access to the data and obtain permission to transmit it; the latter controls packet synchronization, flow control and error checking.
- The data link layer is where most LAN (local area network) and wireless LAN technologies are defined. Technologies and protocols used with this layer are Ethernet, Token Ring, FDDI, ATM, SLIP, PPP, HDLC, and ADCCP.
- The data link layer is often implemented in software as a driver for a network interface card (NIC). Because the data link and physical layers are so closely related, many types of hardware are also associated with the data link layer.
- Data link layer processing is faster than network layer processing because less analysis of the packet is required.
- The Data Link layer also manages physical addressing schemes such as MAC addresses for Ethernet networks, controlling access of any various network devices to the physical medium.


Friday, July 31, 2009

Quick Tech Lesson: Overview Of The Data Link Layer

The task of data link layer is to convert the raw bit stream offered by the physical layer into a stream of frames for use by the network layer. Various framing methods are used , including character count, character stuffing, and bit stuffing. Data link protocols can provide error control to retransmit damaged or lost frames. To prevent a fast sender from overrunning a slower receiver, the data link protocol can also provide flow control. The sliding window mechanism is widely used to integrate error control and flow control in a convenient way.
Sliding window protocols can be categorized by the size of the sender's window and the size of the receiver's window. When both are equal to 1, the protocol is stop-and -wait. When the sender's window is greater than 1, for example to prevent the sender from blocking on a circuit with a long propagation delay, the receiver can be programmed either to discard all frames other than the next one in sequence (protocol 5) or buffer out of order frames until they are needed (protocol 6).
Protocols can be modeled using various techniques to help demonstrate their correctness. Finite state machine models and Petri net models are commonly used for this purpose.
Many networks use one of the bit-oriented protocols-SDLC, HDLC, ADCCP, or LAPB at the data link level. All of these protocols use flag types to delimit frames, and bit stuffing to prevent flag bytes from occurring in the data. All of them also use a sliding window for flow control. The Internet uses SLIP and PPP as data link protocols. ATM systems have their own simple protocol, which does a bare minimum of error checking and no flow control.


Facebook activity