Skip to content

Udemy Course - Fundamentals of Networking for Effective Backend Design

License

Notifications You must be signed in to change notification settings

andrenbrandao/udemy-networking-fundamentals

Repository files navigation

Fundamentals of Networking for Effective Backend Design

Exercises and code from Hussein Nasser's Course Fundamentals of Networking for Effective Backend Design.

How to Run

Install the latest Go version on your computer if it is not already installed. Also, if running the Nodejs servers, install the LTS Version.

Then, go to the udpserver or tcpserver respective directories and execute the following command:

Go:

go run main.go

Nodejs:

node index.mjs

In your terminal, use the Netcat utility to make the requests.

# TCP
nc -t 127.0.0.1 5500

# UDP
nc -u 127.0.0.1 5500

Terminal Commands

Note: I have improved the TCP and UDP servers in Go after reading this article from Linode.

Nagle's Algorithm

This algorithm can affect network performance and to understand it better this article explains the problems with it.

Run tcpdump to observe the behavior.

sudo tcpdump -X  -i lo0 'port 8000'

Go to the tcp-nodelay-go directory and execute the client and servers.

go run client.go
go run server.go

Then, disable TCP_NODELAY to see it in action in the client.go file.

conn.SetNoDelay(false) // Disable TCP_NODELAY; Nagle's Algorithm takes action.

It is also important to know the Delayed Acknowledgement algorithm, because when it works together with Nagle's Algorithm, we may have 400ms delays. The TCP_QUICKACK is the socket option to disable it. Read more.

Extras

License

MIT © André Brandão

About

Udemy Course - Fundamentals of Networking for Effective Backend Design

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published