Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions Week 2-Networking/Assignment_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@
"**Ans :**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Communication: A → F )\n",
"When A sends a message to F, switch S1 notices that A is connected to it and remembers this.\n",
"But it doesn't know where F is, so it sends the message to all its connections, including switch S2.S2 also doesn't know where F is, so it sends the message to all its connected devices. E receives the message and replies. Now, both switches learn where F is, so next time they can send messages directly.\n",
"* Communication: E → B )\n",
"When E sends a message to B, switch S2 learns that E is connected to it. Since S2 doesn't know where B is, it sends the message to S1. S1 then sends the message to all its connections, including B. B replies, and S1 remembers where B is. Now both switches know how to connect E and B without sending messages everywhere.\n",
"* Communication: S2 → C )\n",
"When S2 sends a message to C, it goes through S1. S1 learns where C is and forwards the message. Next time, the message can go more directly.\n",
"* Communication: A → B )\n",
"By now, switch S1 already knows where both A and B are. It sends the message straight to B without any extra steps."
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -119,6 +134,23 @@
"**Ans :**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Communication 1: A to B -> \n",
"When A wants to send a message to B, it first checks if it knows B's MAC address. Since its ARP table is empty, it sends a request asking for B's MAC. Router R1, which connects to both networks, replies with its own MAC address since B is in a different network. A then sends the message to R1. R1 passes the message to R2, which checks its table for B's MAC. If R2 doesn't know it, it asks on the local network, IN 2, and B responds. R2 then delivers the message to B.\n",
"\n",
"* Communication 2: B to C -> Host B determines that Host C is in a different network (N3) and forwards the packet to its default gateway, Router R2. Since Host B does not know R2's MAC address, it sends an ARP request, and R2 responds with its MAC address, allowing Host B to update its ARP table. Router R2 checks its routing table and finds that Network N3 is directly connected, so it forwards the packet to Host C. If R2 does not have Host C's MAC address in its ARP table, it sends an ARP request, and Host C responds, enabling R2 to update its ARP table. Host C also updates its ARP table with R2's MAC address. At the end of this step, Host B's ARP table contains the MAC addresses of both R1 and R2, Host C's ARP table contains R2's MAC address, and R2's ARP table contains the MAC addresses of both Host B and Host C.\n",
"\n",
"* Communication 3: C to A -> \n",
"Host C forwards the packet to its default gateway, Router R2, as Host A is in a different network (N1). If Host C does not already know R2's MAC address, it sends an ARP request, and R2 responds, allowing Host C to update its ARP table.\n",
"Router R2 forwards the packet to Router R1, as R1 connects Network N1, and sends an ARP request to learn R1's MAC address if necessary. R1 responds, enabling R2 to update its ARP table.\n",
"Similarly, R1 forwards the packet to Host A after sending an ARP request to learn Host A's MAC address if needed. Host A responds, and both R1 and Host A update their ARP tables. At the end of this step, Host C's ARP table contains R2's MAC address, Host A's ARP table contains R1's MAC address, R1's ARP table contains the MAC addresses of Host A and R2, and R2's ARP table contains the MAC addresses of Host C and R1.\n",
"\n",
"If the order of communication is reversed, the ARP and routing table population occurs similarly but in the opposite sequence. Since some ARP tables may already be populated from earlier steps, fewer ARP requests might be required, reducing network overhead."
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -164,6 +196,33 @@
"**Ans :**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. HTTP (HyperText Transfer Protocol):\n",
"HTTP is an application-layer protocol for transmitting web pages. It works in a client-server model, where the client sends requests, and the server responds with resources. HTTP uses methods like GET and POST for operations. It operates over TCP (port 80 by default) and is stateless, treating each request independently.\n",
"2. SMTP (Simple Mail Transfer Protocol):\n",
"SMTP is used to send emails. It works over TCP (port 25 or 587) and transfers emails from a sender's email client to an outgoing mail server, then relays them to the recipient's mail server. It handles message submission and delivery but not retrieval.\n",
"3. POP (Post Office Protocol 3):\n",
"POP3 retrieves emails from a mail server to a local device. Operating over TCP (port 110), it downloads emails and deletes them from the server by default, making it less suitable for accessing emails on multiple devices.\n",
"4. IMAP (Internet Message Access Protocol):\n",
"IMAP retrieves and manages emails directly on the server. Operating over TCP (port 143 or 993 for encryption), it supports synchronization across devices, folder organization, and flagging emails without removing them from the server.\n",
"5. FTP (File Transfer Protocol):\n",
"FTP transfers files between a client and a server over TCP (ports 20 and 21). It allows uploading, downloading, and file management but transmits data, including credentials, in plaintext, making it less secure.\n",
"6. SSL (Secure Sockets Layer):\n",
"SSL provides encryption and authentication for secure communication. It prevents eavesdropping and tampering, commonly used in HTTPS for secure web browsing.\n",
"7. TLS (Transport Layer Security):\n",
"TLS, the successor to SSL, enhances encryption, integrity, and authentication. Widely used in HTTPS and other applications, it secures internet communications.\n",
"8. HTTPS (HTTP Secure):\n",
"HTTPS is the secure version of HTTP, using SSL/LS for encryption over port 443. It ensures confidentiality, integrity, and authentication, protecting sensitive information during web"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -208,6 +267,30 @@
"**Ans :**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. DNS (Domain Name System):\n",
"DNS translates human-readable domain names into IP addresses required for communication. It acts as the internet's phonebook, enabling users to access websites without memorizing IP addresses. It uses a hierarchical structure of servers to resolve queries efficiently.\n",
"2. DHCP (Dynamic Host Configuration Protocol):\n",
"DHCP assigns IP addresses dynamically to devices in a network, eliminating the need for manual configuration. It provides additional network settings, such as subnet masks and gateway addresses, ensuring seamless connectivity and reducing configuration errors.\n",
"3. TCP (Transmission Control Protocol):\n",
"TCP is a connection-oriented protocol that ensures reliable data delivery between devices. It establishes a connection using a three-way handshake, segments data into packets, and reassembles them in order at the destination. TCP guarantees error checking and retransmission for lost packets, making it ideal for applications like web browsing and file transfers.\n",
"4. UDP (User Datagram Protocol):\n",
"UDP is a connectionless protocol that prioritizes speed over reliability. It sends data without establishing a connection or guaranteeing delivery. UDP is used in time-sensitive applications like video streaming and online gaming, where occasional data loss is acceptable.\n",
"5. ISPs (Internet Service Providers):\n",
"ISPs provide internet access to users, acting as intermediaries between users and the internet. They manage infrastructure, assign public IP addresses, and ensure connectivity to global networks.\n",
"6. Private IP Addresses:\n",
"Private IP addresses are used within local networks to identify devices. They are not routable on the internet, ensuring security by isolating internal devices from external networks.\n",
"7. NAT (Network Address Translation):\n",
"NAT translates private IP addresses into public IP addresses for internet communication. It conserves IPv4 addresses and enhances security by masking internal network details from external entities.\n",
"8. VPN (Virtual Private Network):\n",
"VPNs establish secure, encrypted connections over public networks, ensuring data privacy and bypassing geo-restrictions. They are widely used for secure remote access.\n",
"9. Firewalls:\n",
"Ciencle morter and cortedl abuse, troth besed arcault ade Than cet co bories"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -260,6 +343,27 @@
"**Ans :**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. User Device:\n",
"The user device initiates the request to access the website by typing the URL into a browser.\n",
"It sends DNS queries to resolve the domain name into an IP address, requests an IP address from the DHCP server (if needed), and establishes a connection to the web server. During login, it sends credentials securely to the authentication server.\n",
"2. DHCP Server:\n",
"The DHCP server assigns a unique IP address and network configuration (subnet mask, gateway, DNS server address) to the user device. This step is crucial for enabling the device to communicate on the network.\n",
"3. DNS Server:\n",
"The DNS server resolves the website's domain name into the corresponding IP address. It directs the user device to the appropriate web server hosting the website.\n",
"4. Web Server:\n",
"The web server hosts the requested website's content. After receiving the user's request, it serves the requested web pages and forwards login details to the authentication server for verification.\n",
"5. Authentication Server:\n",
"This server verifies the user's credentials during the login process. It checks the entered username and password against stored credentials in the database server and determines whether access should be granted.\n",
"6. Database Server:\n",
"The database server stores the website's data, including user credentials, session information, and website content. It interacts with the authentication server to validate user credentials and provides requested data to the web server.\n",
"7. Internet Service Provider (ISP):\n",
"The ISP facilitates internet connectivity by routing the user's request to the DNS server, web server, and other components. It serves as the intermediary between the user device and the broader internet infrastructure."
]
},
{
"cell_type": "markdown",
"metadata": {
Expand All @@ -286,6 +390,19 @@
"source": [
"How do you feel about networking now? 🙃"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I am finding it really intresting.\n",
"Haven't covered the whole topic yet as i have some other work to do but will complete them soon."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down