OSI – Is Addressing Done at Transport Layer or Network Layer?

Networkosi

According to the OSI model, the transport layer divides the data into segments and then attaches the source IP and destination IP along with the port numbers. Also it is said that the network layer does the logical addressing which means the mapping of a address to a unique device on the network. Since IP's are associated already in the transport layer what is the network layer doing with the so called logical addressing. I am confused and would appreciate any kind of help.

Best Answer

Source and destination addresses are found in the IP packet, belonging to the network layer. A transport layer datagram or segment that uses port numbers (=host subaddresses) is wrapped into an IP packet and transported by it.

The network layer uses the IP packet information to transport the packet across the network (routing). Arriving at the destination host, the host's IP stack uses the transport layer information (port number) to pass the information to the application.

IP addresses (and port numbers of course) are referred to as logical addresses because they are assigned to a host by the network (or its administrator) and are used to structure a network. This is in contrast to physical addresses like Ethernet MAC addresses that are assigned by the manufacturer.