Alternating Bit Protocol C Program

  1. See Full List On Cs.xu.edu
  2. Lab #7 – Programming: Reliable Transport - Alternating Bit
  3. Clarke’s Model-checking Flavio Lerda As Part Of Ed ..
  4. Lab 2: Implementing A Reliable Transport Protocol (30 Points)
  5. Alternating Bit Protocol C Programming
  6. Alternating Bit Protocol C Code

In this section, we present an alternating bit protocol with a sender and a receiver processes that are subject to message loss faults. Using the synthesis method presented in 1, we synthesize an alternating bit protocol that is nonmasking fault-tolerant; i.e., when faults occur the program guarantees recovery to its invariant. Implement a stop-and-wait (the alternating bit) protocol which we referred to as rdt3.0 in the text. First you need more background on the environment. The network layer is capable of corrupting and losing packets. It will not reorder packets. When you compile your methods and the provided code together and run the resulting program, you are.

Alternating Bit Protocol C Program

Alternating Bit Protocol

Organisation: LGI/IMAG (Grenoble, France)
Method: LOTOS
Tools used:CADP (Construction and Analysis of Distributed Processes)
Domain: Networks
Period: 1989
Size: 266 lines of LOTOS
up to 520,000 states and 1,700,000 transitions
Description: The alternating bit protocol belongs to the transport layer (4th layer of the OSI model) and implements a reliable transmission service above unreliable communication media.
The protocol was described as a set of four concurrent LOTOS processes: a transmitter, a receiver, and two communication media that can either reliably transmit messages and acknowledgements, or lose them with explicit loss indication, or lose them silently. The specification is parameterized by the number N of different messages that can be sent by the transmitter.
The verification was carried out by generating (using CAESAR) the labelled transition system corresponding to the alternating bit protocol for each value of N in {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 70}, and showing (using ALDEBARAN) observational equivalence with the labelled transition system describing the expected service (i.e., a simple automaton expressing that each message being sent by the transmitter is duly got by the receiver).
Conclusions: This case study was truly the first one performed by jointly using the CAESAR and ALDEBARAN tools, the combination of which gave birth to the CADP toolbox.
Taking the alternating bit protocol as a example, the study demonstrated that model-based verification (namely, state space exploration and equivalence checking) was tractable for descriptions written in a process calculus such as LOTOS, in contrast with approaches based on symbolic simulation and theorem proving that had been predominating so far.
Publications: [Garavel-89-b-CD] Hubert Garavel. 'Utilisation de CAESAR et ALDEBARAN'. Technical report, 24 pages, in French.
Based on Appendix C of Hubert Garavel's PhD thesis 'Compilation et vérification de programmes LOTOS', Thèse de Doctorat, Université Joseph Fourier (Grenoble), November 1989. http://cadp.inria.fr/publications/Garavel-89-b.html
Available on-line from: http://cadp.inria.fr/publications/Garavel-89-b-CD.html
or from the CADP Web site in PDF or PostScript
Contact:
Hubert Garavel
LGI - IMAG Campus
BP 53X
38041 GRENOBLE cedex
FRANCE
Further remarks: The LOTOS descriptions as well as explanations on the verification with CADP are available on-line at:
http://cadp.inria.fr/ftp/demos/demo_02
This case study, amongst others, is described on the CADP Web site: http://cadp.inria.fr/case-studies
Last modified: Thu Feb 11 12:42:30 2021. Back to the CADP case studies page

See Full List On Cs.xu.edu

Open questions¶

  1. Consider a b bits per second link between two hosts that has a propagation delay of t seconds. Derive a formula that computes the time elapsed between the transmission of the first bit of a d bytes frame from a sending host and the reception of the last bit of this frame on the receiving host.

  2. Transmission links have sometimes different upstream and downstream bandwidths. A typical example are access networks that use ADSL (Asymmetric Digital Subscriber Lines). Consider two hosts connected via an ADSL link having an upstream bandwidth of 1 Mbps and a downstream bandwidth of 50 Mbps. The propagation delay between the two hosts is 10 milliseconds. What is the maximum throughput, expressed in frames/second, that the alternating bit protocol can obtain on this link if each data frame has a length of 125 bytes and acknowledgments are 25 bytes long. Same question if the protocol is modified to support 1500 bytes long data frames.

  3. How would you set the duration of the retransmission timer in the alternating bit protocol ?

  4. A version of the Alternating Bit Protocol supporting variable length frames uses a header that contains the following fields :

    • a number (0 or 1)

    • a length field that indicates the length of the data

    • a Cyclic Redundancy Check (CRC)

    To speedup the transmission of the frames, a student proposes to compute the CRC over the data part of the frame but not over the header. What do you think of this proposed solution ?

  5. Derive a mathematical expression that provides the goodput, i.e. the amount of payload bytes that have been transmitted during a period of time, achieved by the Alternating Bit Protocol assuming that :

    • Each frame contains D bytes of data and c bytes of control information

    • Each acknowledgment contains c bytes of control information

    • The bandwidth of the two directions of the link is set to B bits per second

    • The delay between the two hosts is s seconds in both directions

    • there are no transmission errors

  6. Consider a go-back-n sender and a go-back receiver that are directly connected with a 10 Mbps link that has a propagation delay of 100 milliseconds. Assume that the retransmission timer is set to three seconds. If the window has a length of 4 frames, draw a time-sequence diagram showing the transmission consisting of 10 data frames (each frame contains 10000 bits):

  • when there are no losses

  • when the third and seventh frames are lost

  • when every second acknowledgment is discarded due to transmission errors

  1. Same question when using selective repeat instead of go-back-n. Note that the answer is not necessarily the same.

Practice¶

Lab #7 – Programming: Reliable Transport - Alternating Bit

Reliable protocols depend on error detection algorithms to detect transmission errors. The following questions will reinforce your understanding of these algorithms.

  1. Reliable protocols rely on different types of checksums to verify whether frames have been affected by transmission errors. The most frequently used checksums are :

  • the Internet checksum used by UDP, TCP and other Internet protocols which is defined in RFC 1071 and implemented in various libraries.

  • the 16 bits or the 32 bits Cyclical Redundancy Checks (CRC) that are often used on disks, in zip archives and in datalink layer protocols. See http://rosettacode.org/wiki/CRC-32 for CRC-32 implementations in various languages.

  • the Fletcher checksum [Fletcher1982], see https://en.wikipedia.org/wiki/Fletcher%27s_checksum for implementation details. Dragon city game.

By using your knowledge of the Internet checksum, can you find a transmission error that will not be detected by these checksums?

Clarke’s Model-checking Flavio Lerda As Part Of Ed ..

  1. The Cyclic Redundancy Checks (CRCs) are efficient error detection codes that are able to detect :

  • all errors that affect an odd number of bits

  • all errors that affect a sequence of bits which is shorter than the length of the CRC

Implement a small software that computes the CRC-32 for a text file. Then, modify the contents of the file to change an even number of bits or an odd number of bits inside the file. When modifying the file, remember that an ASCII file is composed of 8 bits characters that are encoded by using the ASCII table that you can find at : http://en.wikipedia.org/wiki/ASCII . You can also write a small program that produces binary files that are a small variation of each other.

Lab 2: Implementing A Reliable Transport Protocol (30 Points)

  1. Checksums and CRCs should not be confused with secure hash functions such as MD5 defined in RFC 1321 or SHA-1 described in RFC 4634. Secure hash functions are used to ensure that files or sometimes frames/packets/segments have not been modified. Secure hash functions aim at detecting malicious changes while checksums and CRCs only detect random transmission errors. Use the shasum or md5sum programs on Linux to perform the same tests as above.

Discussion questions¶

  1. Consider two high-end servers connected back-to-back by using a 10 Gbps interface. If the delay between the two servers is one millisecond, what is the throughput that can be achieved by a reliable protocol that is using 10,000 bits frames and a window of

Alternating Bit Protocol C Programming

  1. Is it possible for a go-back-n receiver to inter-operate with a selective-repeat sender ? Justify your answer.

  2. Is it possible for a selective-repeat receiver to inter-operate with a go-back-n sender ? Justify your answer.

Alternating Bit Protocol C Code

  1. A go-back-n sender has sent (2^n) data frames. Iomega predator driver. All the frames have been received correctly and in-order by the receiver, but all the returned acknowledgments have been lost. Show by using a time sequence diagram (e.g. by considering a window of four frames) what happens in this case. Can you fix the problem on the go-back-n sender ?

  2. Same question as above, but assume now that both the sender and the receiver implement selective repeat. Note that the answer can be different from the above question.