The Network Layer is Layer 3 of the seven layer OSI model of computer networking. The key element of the Network Layer are addressing and routing.
The Network Layer defines how information moves to the correct network address, how messages are addressed and how logical addresses and names are translated into physical addresses, as well as enabling the option of specifying a service address, known as a sockets or ports. to point the data to the correct program on the destination computer.
Each computer on a TCP/IP network has to have a unique, numeric IP address. The IP address is like a mailing address, some of the bits represent the network segment that the computer is on, like the street name of a mailing address. Other bits represent the particular host on the segment, like the house number of a mailing address.
IP addresses have 4 bytes, each of which is referred to as an octet. Since each byte in the address has 8 bits, an IP address is 32 bits long. IP addresses are usually displayed in decimal format where the value of each byte is converted from binary to decimal. This makes them easier to remember. For example, an IP address of 22.214.171.124 is much easier to remember than its binary equivalent of: 01001010.00110100.10010111.10110010
If an IP address represents a mailing address, thing of the service address as a specific room in the house. The service address is a number that is appended to the IP Address such as 126.96.36.199:25 where 188.8.131.52 is the IP address and 25 is the service address. In the early days of computer networking the term socket number was use. A well-known range of port numbers is reserved by convention to identify specific service types on a host computer.
On most IP networks, computers have not only IP addresses, but they also have descriptive names that are easier for people to remember and use. This name is called the host name. It's a friendly name assigned to a computer that people can use instead of the numeric IP address
Routing is the process of selecting which physical path the information should follow from its source to its destination. The Network Layer manages data traffic and congestion involved in packet switching and routing
Routers are devices that play a significant role in directing the flow of data between two or more networks. Routers make sure that information makes it to the intended destination as well as ensure that information does not go where it is not needed. This is crucial for keeping large volumes of data from clogging connections.
One of the tools a router uses to decide where a packet should go is a configuration table. A configuration table identifies which connections lead to particular groups of addresses and sets priorities for connections to be used and establishes rules for handling both routine and special cases of traffic.
A configuration table can be as simple as a half-dozen lines in the smallest routers, but can grow to massive size and complexity in the very large routers that handle the bulk of Internet messages.
Internet Protocol (IP) envelopes and addresses the data, enables the network to read the envelope and forward the data to its destination and defines how much data can fit in a single packet.
Internet Protocol (IP) is a connectionless protocol, which means that a session is not created before sending data. IP is responsible for addressing and routing of packets between computers. It does not guarantee delivery and does not give acknowledgement of packets that are lost or sent out of order as this is the responsibility of higher layer protocols such as Transmission Control Protocol (TCP).
Time To Live (TTL) is a concept in IP that prevents packets from endlessly looping around the Internet. When a packet leaves a computer the TTL is set to a maximum of 256 Each router will decrease the TTL by one or more If the TTL reaches Zero, the Router Sends the Source Computer a ICMP-Time Exceeded and discards the packet
Throughout the standard for Internet Protocol you will see the description of packet switching, "fragment and reassemble internet datagrams when necessary for transmission through small packet networks." A message is divided into smaller parts know as packets before they are sent. Each packet is transmitted individually and can even follow different routes to its destination. Once all the packets forming a message arrive at the destination, they are recompiled into the original message.