The TCP/IP Protocol (Transmission Control Protocol/Internet Protocol) is the fundamental set of rules that governs virtually all communication over the internet, making it the main protocol.
TCP/IP defines how electronic devices should connect to the Internet and how data should be transmitted between them. It ensures that data sent from one device (like a web server) is correctly received by another (like a user's browser), regardless of the network technology or operating system used by either device.
<aside> π‘
The HTTP protocol that we will discuss in the next chapter uses the TCP/IP protocol under the hood to transfer requests and responses between clients (e.g., browsers) and servers.
</aside>
When you access a website, the information you request, whether it's an image, a large HTML file or video, is broken down and sent across the network as small, manageable chunks called packets.
Once all the packets arrive at the destination, TCP uses the sequence numbers to put them back in the correct order, reassembling the original, complete file or message for the web browser to display.
An IP Address is a unique numerical label assigned to every device (computer, server, smartphone) connected to a computer network that uses the Internet Protocol for communication. It acts as the address for your device on the internet. Its main job is to identify a device and its location so that data packets can be routed correctly across the network.
The Domain Name System (DNS) is a global, distributed directory service. It translates human-readable Domain Names (like google.com) into the numerical IP Addresses (like 142.251.36.46) that computers need to find each other.
Since humans remember names better than long strings of numbers, DNS acts as the Internet's phone book.
When you type a web address into your browser:
This step is critical for web development because a web server's IP address might change (e.g., if you switch hosting providers), but the domain name remains the same, thanks to DNS updates.
ping CommandThe ping command tests basic connectivity and measures round-trip time (latency) to a destination host (IP address or domain name). It repeatedly sends βpingβ messages to the specified address (either a numerical IP address or a DNS name) and shows statistics about the replies from the destination address. It includes the numeric IP address of the responder, if any. Example:
> ping google.com
PING google.com (142.250.179.174): 56 data bytes
64 bytes from 142.250.179.174: icmp_seq=0 ttl=120 time=14.732 ms
64 bytes from 142.250.179.174: icmp_seq=1 ttl=120 time=12.148 ms
64 bytes from 142.250.179.174: icmp_seq=2 ttl=120 time=12.247 ms
64 bytes from 142.250.179.174: icmp_seq=3 ttl=120 time=7.617 ms
64 bytes from 142.250.179.174: icmp_seq=4 ttl=120 time=8.698 ms
^C
Press Ctrl-C to stop the ping command.
In this example, the IP address of the DNS name google.com is 142.250.179.174.
<aside> β¨οΈ
Try it yourself!
microsoft.com.hyf123.com.
</aside>nslookup CommandAnother way to quickly look up the IP address, given a domain name, is by using the nslookup command. In this case, the name is resolved by querying the Domain Name System (DNS) servers.
> nslookup google.com
Server: 192.168.178.1
Address: 192.168.178.1#53
Non-authoritative answer:
Name: google.com
Address: 142.250.179.174
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 **
