1

This question already has an answer here:

enter image description hereTake an example of searching www.example.com in a web browser. I have some confusions at each layer and they are

  1. We have opened a web browser and searched for www.example.com. Now, As far as I know, the Application layer appends a header of HTTPS GET request to example.com, resolves IP address using DNS. That means, the IP address is known at this layer itself, but why is the IP address appended at the Network layer and not at the Application layer?. And how does it resolve the IP address of google.com? Does it follow the same 7-layer model to resolve IP addresses or it is a separate task and follows different scenario.

  2. Okay... now the application layer passed the PDU to the presentation layer. Here it translates, encrypts and compresses the PDU. Does it always perform these three function at physical layer.?

  3. Well, now the PDU gets passed to the session layer. I read somewhere that it create session between sender and receiver, maintains session, authenticates, authorizes and synchronizes. what do you mean by creating a session, how come it creates a session between sender and receiver without even getting to the next layers.

  4. Ok, somehow the PDU got to the Transport layer. Here it divides the PDU into transmittable segments. And appends each segment with a sequence number, ACK number, port number etc. But, how does it know the port number of server (ie 443 for HTTPS request?) and what about client port numbers. And the main question here is how it handles TCP 3-way handshaking. Handshaking means it needs to send SYN packet to the destination via a route and must receive ACK through the same path. My query is, how it does 3-way handshaking without even getting to the lower layers

  5. Now it appends IP addresses of sender and receiver to the PDU along with some other control information. Why it adds an IP address here, not at application layer. PDU is called a packet here in network layer.

  6. Now it appends the MAC address of the next device the host is connected to along with some other information. My doubt is, does the data link layer append the MAC address of router to transmit the data to another router?

  7. Now, the Frames become signal and transmitted over a channel (LAN cable) to the switch connected to the computer. It is a physical layer.

What happens next is my analogy. correct me if I'm wrong anywhere.

Now, at the switch, the signal become frames and changes the MAC address to next devices it connects, for example the switch is connected to a router. So, the switch appends MAC address of the router and make those frames as a signal and transmits over a channel connected to the switch.

Now, the router takes the data, removes the MAC addresses, so that it can look the IP addresses and forwards the data to the next node (probably router) by looking into the routing table based on the destination address. That means, does the router append the MAC address of the next router.

And continues till it reaches the server.

At the receiving side router (the last router), does the router append MAC address of the server while transmitting? Ok.. somehow the requested data gets to the server. Does the server itself remove the data link headers, network layer headers?

And finally request has reached to server's application layer by unwrapping the headers layer by layer in the server.

Now, does it follow the same steps to send the requested web page to the client?

marked as duplicate by Ron Maupin Mar 25 at 14:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please Refer below link, You will understand. webopedia.com/quick_ref/OSI_Layers.asp – infra Mar 25 at 11:10
  • Hi Thrinadh, welcome to NESE. I think you'll find this article on my blog useful. It explains the OSI layers and each of their responsibilities from a practical perspective. – Eddie Mar 25 at 12:51
  • Not all data-link protocols use MAC addresses, and a lot of WAN data-link protocols do not use MAC addresses. In any case, the OSI model is just a model, and you will not find any OSes that implement separate layers 5 to 7. – Ron Maupin Mar 25 at 13:34
  • I have looked into all other answers in stackexchange and I liked your answers. But I wanted to know more about those layers. So, I have asked some doubts that were not in other answers. This is not a duplicate question sir. please look into the doubts I have posted. @RonMaupin – Thrinadh Reddy Mar 26 at 3:22
3

The fundamental thing to understand is the separation of layers: don't try to understand all the layers at the same time. And probably best not to start with complex ones like HTTPS. Also it's vital to remember that the OSI seven layer model is just a story to help explain similarities and differences of networking processes; it is not followed by the internet model of networking.

Try first with basic layer 2 and layer 3 frames and packets, then with simple protocols, perhaps Daytime (RFC 867), then HTTP, then DNS, then your example.

Try not to think of "appending addresses", think in terms of each layer doing its job. When we think of the TCP connection from client to server, we completely ignore all the packet activity. When we think about packets, we ignore TCP streams and ethernet frames. When we think of the frames out of the client, we ignore all IP behaviour.

To get to your questions, try a top-down view:

  • First, client does a DNS request to its locally configured DNS resolver, whose IP address it knows.
  • If successful it makes a TCP connection to the server's IP address, on the well-known port number 443.
  • If successful it starts talking HTTPS over that connection. Part of that is the web page content returning.

Once that's clear, then you can drill down into how each of those works.

3

First things first: The TCP/IP suite of protocols was NOT based on the OSI model. Therefore, it is useless to attempt to describe them using that model. The TCP/IP model is much closer, but even so, models are abstract representations of functions, and they don't always match what is actually used.

You have many questions to answer, but let me make some general comments:

The reason we talk about layers at all is so functions can be decoupled from each other. The reason HTTPS doesn't include IP addresses is that HTTP doesn't care how servers are addressed. It could be IPv4, IPv6, or some other future protocol. HTTPS just expects a stream of data. How it gets there is not important.

DNS is a separate application protocol. It is not part of HTTP, nor is it required.

Before HTTPS information can be sent to the server, a session has to be established first. The TCP connection (3-way handshake) is set up before data is actually sent. The reason your computer knows to use port 443 is because that is the "well-known" port number for HTTPS traffic. It's the same reason that you know to call 911 (at least in North America) on your telephone to request police, fire, or an ambulance.

The destination MAC address of the frame is either the address of the destination host (if it is on the same segment) or the address of the next hop router. Switches DO NOT change MAC addresses.

1

The data flow is simple.

Across a router you've got (from here):

enter image description here

The applications sit in L7 and talk to each other using the full host stacks with a router in the middle, forwarding between interfaces at L3. Just add more router in between if you like. You can also add a switch anywhere that forwards at L2.

Not the answer you're looking for? Browse other questions tagged or ask your own question.