TCP. UDP. Network

June 17, 2020 · View on GitHub

MIT Licensed Awesome       

TCP. UDP. Network

  1. Internet 101
  2. Networking for Web Developers
  3. How DNS Works
  4. :vertical_traffic_light:Node.js:vertical_traffic_light:TCP client in Node.js:vertical_traffic_light:Node.js:vertical_traffic_light:
  5. :vertical_traffic_light:Python:vertical_traffic_light:TCP Communication:vertical_traffic_light:Python:vertical_traffic_light:
  6. :vertical_traffic_light:Golang:vertical_traffic_light:TCP client and server in Golang:vertical_traffic_light:Golang:vertical_traffic_light:

Finish the courses (1), and (2) and read article (3) above.

  1. Make screenshots of your finished lessons from (1), (2) and put the screenshots in task_networks folder in your kottans-backend repo
  2. In your kottans-backend repo README.md:
    • add header ## TCP. UDP. Network
    • embed the screenshots or add links to the screenshots
    • list your reflections on all subtasks (what was new to you, what surprised you, what you intend to use in future)
  3. In your task_networks folder build a following program:

TCP Port Sniffer :nose:

Sniffer is CLI tool which allows user to easily search for opened TCP ports on particular host (using IP adderess or domain). Example of usage:

:vertical_traffic_light:Node.js:vertical_traffic_light:

node sniffer.js --ports 10-9999 --host 172.217.3.110

....

22,54,80,443 ports are opened

:vertical_traffic_light:Node.js:vertical_traffic_light:

:vertical_traffic_light:Golang:vertical_traffic_light:

go run sniffer.go --ports 10-9999 --host 172.217.3.110

....

22,54,80,443 ports are opened

:vertical_traffic_light:Golang:vertical_traffic_light:

:vertical_traffic_light:Python:vertical_traffic_light:

python sniffer.py --ports 10-9999 --host 172.217.3.110

....

22,54,80,443 ports are opened

:vertical_traffic_light:Python:vertical_traffic_light:

TCP Sniffer User Stories
  • As the user, I can call sniffer from my shell with one required argument --host which can be either domain name, like google.com or IP address like 172.217.3.110.
  • After call program will start TCP ports scan, trying to dial each port from 0 to 65535. If dial is successful program will print dot . to stdout and save found open port to buffer array. IMPORTANT: Each dial attempt should have 300ms timeout. (If client fails to connect in 300ms port is skipped).
  • After scan is finished program will print the list of opened ports to stdout and exit with status code 0.
  • As the user, I can limit the range of ports to scan by providing --ports argument in format <start_port>-<end_port>, for instance: 3-600.
  • As the user, I can get a descriptive error if required argument is missing or if some of them have incorrect format.
  • As the user, I can provide --help flag to see hint about how to use TCP sniffer.
TCP Sniffer Submission

Save your program in a file. Follow instructions in this repo to submit your code.

  1. You did lot already! If you honestly finished all the previous steps then go ahead and share it with others – post a message in course channel: TCP. UDP. Network — #done (or TCP. UDP. Network — #done if you are p2p course student) and add the link to your repo. This step is important, as it helps mentors to track your progress! When complete do the following:

Extra materials

  1. Introduction to TCP/IP. Course
  2. What happens when you type google.com into your browser and press enter?
  3. Big list of TCP/UDP ports
  4. :vertical_traffic_light:Node.js:vertical_traffic_light:Module 'net' Node.js docs:vertical_traffic_light:Node.js:vertical_traffic_light:
  5. :vertical_traffic_light:Golang:vertical_traffic_light:Package 'net' Golang docs:vertical_traffic_light:Golang:vertical_traffic_light:
  6. :vertical_traffic_light:Python:vertical_traffic_light:TCP echo client in Python:vertical_traffic_light:Python:vertical_traffic_light:

Done?

➡️ Go forward to HTTP & HTTPs

⤴️ Back to Contents