Write python code that will transfer a file reliably

Assignment Help Computer Engineering
Reference no: EM132212212

Write python code that will transfer a file reliably between two hosts (a sender and a receiver).

Regarding the transport protocol service, you have to design your own packet format and use UDP as underlying transport protocol. Your packet might include fields for: type, sequence number, acknowledgement number, advertised window / window size, data, checksum or CRC, etc.

This part of the assignment is entirely up to you. Your code MUST adhere to the following:

• The sender must accept data from standard-input (stdin), sending data until an end-of-file (eof) is reached.

• The sender and receiver must work together to transfer the data reliably.

• The receiver must output the received data to standard-output (stdout), in order, and without errors.

• The sender and receiver must print out specified debugging messages to standard-error (stderr).

• The sender and receiver must gracefully exit.

•Your code must be able to transfer a file regardless of file size or type, with any number of packets dropped, damaged, duplicated, and delayed, and under a variety of different available bitrates and link latencies. you should detect errors, send acknowledgments, have timeouts, and retransmit if needed.

You will submit two programs: a sender program that accepts data and sends it across the network, and a receiver program that receives the sent data and outputs it correctly, in-order. You must use Python to implement both programs. The client sender program takes command line arguments of the remote receiver IP address and UDP port number. To aid in grading and debugging, when your sender sends a packet (including retransmissions), it should print the following to stderr:

<timestamp>[sending] start (length)

where timestamp is a timestamp (down to the microsecond), start is the beginning offset of the data sent in the packet, and length is the amount of the data sent in that packet. When your sender receives an acknowledgement, you should also print to stderr:

<timestamp>[recv ack] end

where end is the last offset that was acknowledged. You may also print some messages of your own to indicate timeouts, etc., depending on your design, but make it concise and readable.

The receiver program takes a command line argument which is the UDP port number to use for receiving datagrams. The receiver program will start up and will bind to the local UDP port and once bound, it will print out the following to stderr:

<timestamp> [bound] port

To aid in grading and debugging, when your receiver receives a valid data packet, it should print to stderr:

<timestamp> [recv data] start (length) status

where start is the beginning offset of the data sent in the packet, and length is the amount of the data sent in that packet, and status is one of ACCEPTED (in-order), ACCEPTED (out-of-order), or IGNORED. If a corrupt packet arrives, your receiver should print to stderr:

<timestamp> [recv corrupted packet]

Similar to the sender, you may add your own output messages. Both the sender and the receiver should print out a message to stderr after completion of file transfer, and then exit gracefully:

<timestamp> [completed]

Reference no: EM132212212

Questions Cloud

Write a python function which takes two parameters : Write a python function which takes two parameters and then output the sum of these two numbers?
Outline the reasons why various elements of culture : Outline the reasons why the various elements of culture (social structures and control systems, language and aesthetics, religion and other belief systems)
Compute and print out how many total words it contains : For both files, compute and print out how many total words it contains and how many distinct words they contain.
What sort of adaptations might be beneficial : An adaptation is a characteristic of a population that develops over time that proves beneficial to that population in surviving and reproducing.
Write python code that will transfer a file reliably : Write python code that will transfer a file reliably between two hosts (a sender and a receiver).
Disclosure test before engaging in these corporate misdeeds : How do you think Kozlowski would have acted had he considered the public disclosure test before engaging in these corporate misdeeds?
Explain your choices and your reasoning : There are many factors influencing the cost of money for both individuals and corporations. Suppose you deposit money in an interest bearing account.
About entrepreneurship in general and success specifically : If you had the opportunity to spend an hour with some great entrepreneur and pick their brain about entrepreneurship in general and their success specifically,
Write a python program that asks users to input an integer : Write a Python program that asks users to input an integer number and print the summation of its digits and total number of its digits.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd