Hacktoberfest-2k18 icon indicating copy to clipboard operation
Hacktoberfest-2k18 copied to clipboard

TCP protocol implementation

Open Ram-Aditya opened this issue 6 years ago • 7 comments

Description

Implement a simple TCP protocol to open a TCP connection and retrieve data from the client.

  • Consider a function named as client() as the client and the function named server() as the server. The communication between the client and server is through calling one function from the other. The data to be passed is passed as an argument to the called function. The data returned by the server() function can be regarded as the response that the server provides to its client. For your implementation, there is no need to use any sort of addressing mechanisms such as IP addresses.

  • We would like you to simulate the following scenario:

    • Client wants to access a static data stored in a variable called “client_data” which has a randomly initialized value. The entire process of retrieving data from the server will be done in the 3 steps.

      • Open TCP connection as per the TCP protocol (using request and acknowledgment).
      • Client requests the “client_data”. Client and server communicate to share data.
      • Client closes the connection.
  • After each step, i.e whenever the client calls server/whenever the server responds, print appropriate statements to the screen stating the source and destination of the messages exchanged and the content and types of each of these messages .

Details

  • Technical Specifications:

    • You must use any one of the following programming languages: Python, Java, C, C++.
  • Type of issue: No more than one implementation will be accepted for each language. Once the implementation for a language has been taken up (i.e if it is checked in the 'Issue Progress' section), you must choose from the remaining.

  • Time Limit: Issues will be given on a first-come, first-serve basis. Once you take this issue up, you must complete it within 3 days, failing which the issue will be allocated to the next person who requested for this issue.

  • Additional Instructions:

    • While making the Pull Request, attach screenshots of one run of the above scenario.

Issue progress

  • [x] Python
  • [ ] C++
  • [ ] Java
  • [ ] C

Resources

https://www.lifewire.com/tcp-transmission-control-protocol-3426736 Refer https://en.wikipedia.org/wiki/Transmission_Control_Protocol under the section 'Protocol operation'.

Directory Structure

For this issue, use the following directory of theHacktoberfest-2k18 repository: /systems/networks/tcp/function_call/language_name

(where language_name is one of the languages mentioned above.)

Note

Please claim the issue first by commenting here before starting to work on it.

Ram-Aditya avatar Oct 02 '18 21:10 Ram-Aditya

Hello. I would like to claim this issue in java for myself. Thank you.

Piemaster651 avatar Oct 03 '18 16:10 Piemaster651

@ColesSA Thank you for showing interest in contributing to our repository. Sure you can go ahead and start working on it :)

mahim23 avatar Oct 03 '18 16:10 mahim23

@ColesSA any progress? We would like to see a PR soon :)

pvgupta24 avatar Oct 06 '18 06:10 pvgupta24

Hello. I would like to claim this issue for python.

rajat1433 avatar Oct 08 '18 06:10 rajat1433

@rajat1433 , go ahead :)

pvgupta24 avatar Oct 08 '18 06:10 pvgupta24

Done!!

rajat1433 avatar Oct 08 '18 11:10 rajat1433

@ColesSA Sorry, since you haven't submitted a pull request within the time limit, we will be handing over the implementation in Java to the next person requesting it. Although you can still claim the implementation for either C or C++.

Ram-Aditya avatar Oct 10 '18 15:10 Ram-Aditya