go-back-n | Go-Back-N ARQ scheme implemented in Python
kandi X-RAY | go-back-n Summary
kandi X-RAY | go-back-n Summary
Go-Back-N ARQ scheme implemented in Python
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Send a file to the server
- Calculate the checksum of a message
- Pack the contents of the file content into a list
- Pack data for a message
- Calculate the carry of a checksum
- Ack listen thread
- Sets up a socket
- Timer function
- Calculate checksum of a message
- Sends an ACK
- Parse command line arguments
go-back-n Key Features
go-back-n Examples and Code Snippets
Community Discussions
Trending Discussions on go-back-n
QUESTION
I received an assignment from the College where I have to implement a reliable transfer through UDP aka. TCP Over UDP (I know, reinvent the wheel since this has already been implemented on TCP) to know in deep how TCP works. Some of the requirements are: 3-Way Handshake, Congestion Control (TCP Tahoe, in particular) and Waved Hands. I think about doing this with Java or Python.
Some more specific requirements are:
After each ACK is received:
- (Slow start) If
CWND < SS-THRESH: CWND += 512
- (Congestion Avoidance)
If CWND >= SS-THRESH: CWND += (512 * 512) / CWND
- After timeout, set
SS-THRESH -> CWND / 2
,CWND -> 512
, and retransmit data after the last acknowledged byte.
I couldn't find more specific information about the TCP Tahoe implementation. But from what I understand, TCP Tahoe is based on Go-Back-N, so I found the following pseudo algorithm for sender and receiver:
My question is the Slow Start and Congestion Avoidance phase should happen right after if sendbase == nextseqnum
? That is, right after confirming the receipt of an expected ACK?
My other question is about the Window Size, Go-Back-N uses a fixed window whereas TCP Tahoe uses a dynamic window. How can I calculate window size based on cwnd?
...ANSWER
Answered 2022-Jan-20 at 07:38Note: your pictures are unreadable, please provide a higher resolution images
I don't think that algorithm is correct. A timer should be associated with each packet and stopped when ACK for this packet is received. Congestion control is triggered when the timer for any of the packets fires.
TCP is not exactly Go-Back-N receiver. In TCP receiver has a buffer too. This does not require any changes at the sender Go-Back-N. However, TCP is also supposed to implement flow control, in which the receiver tells the sender how much space in its buffer remains, and the sender adjusts its window accordingly.
Note, that Go-Back-N sequence number count packets, and TCP sequence numbers count bytes in the packets, you have to change your algorithm accordingly.
I would advice to get somewhat familiar with rfc793. It does not have congestion control, but it specifies how other TCP mechanics is supposed to work. Also this link has a nice illustration of TCP window and all variables associated with it.
My question is the Slow Start and Congestion Avoidance phase should happen right after if sendbase == nextseqnum? That is, right after confirming the receipt of an expected ACK?
your algorithm only does something when it receives ACK for the last packet. As I said, this is incorrect.
Regardless. Every ACK that acknowledges new packet shoult trigger window increase. You can do check this by checking if send_base
was increased as the result of an ACK.
Dunno if every Tahoe implementation does this, but you may need this also. After three consequtive duplicate ACKs, i.e., ACKs that do not increase send_base
you trigger congestion response.
My other question is about the Window Size, Go-Back-N uses a fixed window whereas TCP Tahoe uses a dynamic window. How can I calculate window size based on cwnd?
you make the N
variable instead of constant, and assign congestion window to it.
in a real TCP with flow control you do N = min (cwnd, receiver_window)
.
QUESTION
I am having issues with the socket only recieving data, but not the address so I cannot send packets such as an acknowledgement to the original sender. I am implementing a go-back-N with a sender and receiver. Here is the error:
...ANSWER
Answered 2020-Nov-09 at 02:07serversocket.recv(1500)
only returns bytes, not data, client_address
. You're looking for recvfrom
.
And this should enlighten you as to why you get the error you do:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install go-back-n
You can use go-back-n like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page