Network Layer Unit 3 PDF

Summary

This document provides a comprehensive overview of the Network Layer, a crucial component of the OSI model in computer networking. It details the functions of this layer, including routing, logical addressing, and fragmentation. The document also explains the Point-to-Point Protocol (PPP) and its services.

Full Transcript

Network Layer - The Network Layer is the third layer of the OSI model. - It handles the service requests from the transport layer and further forwards the service request to the data link layer. - The network layer translates the logical addresses into physical addresses - It det...

Network Layer - The Network Layer is the third layer of the OSI model. - It handles the service requests from the transport layer and further forwards the service request to the data link layer. - The network layer translates the logical addresses into physical addresses - It determines the route from the source to the destination and also manages the traffic problems such as switching, routing and controls the congestion of data packets. - The main role of the network layer is to move the packets from sending host to the receiving host. The main functions performed by the network layer are: - **Routing:** When a packet reaches the router\'s input link, the router will move the packets to the router\'s output link. For example, a packet from S1 to R1 must be forwarded to the next router on the path to S2. - **Logical Addressing:** The data link layer implements the physical addressing and network layer implements the logical addressing. Logical addressing is also used to distinguish between source and destination system. The network layer adds a header to the packet which includes the logical addresses of both the sender and the receiver. - **Internetworking:** This is the main role of the network layer that it provides the logical connection between different types of networks. - **Fragmentation:** The fragmentation is a process of breaking the packets into the smallest individual data units that travel through different networks. PPP Protocol The PPP stands for Point-to-Point protocol. It is the most commonly used protocol for point-to-point access. Suppose the user wants to access the internet from the home, the PPP protocol will be used. It is a data link layer protocol that resides in the layer 2 of the [OSI model](https://www.javatpoint.com/osi-model). It is used to encapsulate the layer 3 protocols and all the information available in the payload in order to be transmitted across the serial links. The PPP protocol can be used on synchronous link like ISDN as well as asynchronous link like dial-up. It is mainly used for the communication between the two devices. It can be used over many types of physical networks such as serial cable, phone line, trunk line, cellular telephone, fiber optic links such as SONET. As the data link layer protocol is used to identify from where the transmission starts and ends, so ISP (Internet Service Provider) use the PPP protocol to provide the dial-up access to the [internet](https://www.javatpoint.com/internet). Services provided by PPP - It defines the format of frames through which the transmission occurs. - It defines the link establishment process. If user establishes a link with a server, then \"how this link establishes\" is done by the PPP protocol. - It defines data exchange process, i.e., how data will be exchanged, the rate of the exchange. - The main feature of the PPP protocol is the encapsulation. It defines how network layer data and information in the payload are encapsulated in the data link frame. - It defines the authentication process between the two devices. The authentication between the two devices, handshaking and how the password will be exchanged between two devices are decided by the PPP protocol. Services Not provided by the PPP protocol - It does not support flow control mechanism. - It has a very simple error control mechanism. - As PPP provides point-to-point communication, so it lacks addressing mechanism to handle frames in multipoint configuration. It is a byte-oriented protocol as it provides the frames as a collection of bytes or characters. It is a WAN (Wide Area Network) protocol as it runs over the [internet](https://www.javatpoint.com/internet-full-form) link which means between two routers, internet is widely used. PPP has two main uses which are given below: - It is widely used in broadband communications having heavy loads and high speed. For example, an internet operates on heavy load and high speed. - It is used to transmit the multiprotocol data between the two connected (point-to-point) computers. It is mainly used in point-to-point devices, for example, routers are point-to-point devices where PPP protocol is widely used as it is a WAN protocol not a simple LAN ethernet protocol. Frame format of PPP protocol **The frame format of PPP protocol contains the following fields:** PPP Protocol - **Flag:** The flag field is used to indicate the start and end of the frame. The flag field is a 1-byte field that appears at the beginning and the ending of the frame. The pattern of the flag is similar to the bit pattern in HDLC, i.e., 01111110. - **Address:** It is a 1-byte field that contains the constant value which is 11111111. These 8 ones represent a broadcast message. - **Control:** It is a 1-byte field which is set through the constant value, i.e., 11000000. It is not a required field as PPP does not support the flow control and a very limited error control mechanism. The control field is a mandatory field where protocol supports flow and error control mechanism. - **Protocol:** It is a 1 or 2 bytes field that defines what is to be carried in the data field. The data can be a user data or other information. - **Payload:** The payload field carries either user data or other information. The maximum length of the payload field is 1500 bytes. - **Checksum:** It is a 16-bit field which is generally used for error detection. Transition phases of PPP protocol **The following are the transition phases of a PPP protocol:** ![PPP Protocol](media/image2.png) - **Dead:** Dead is a transition phase which means that the link is not used or there is no active carrier at the physical layer. - **Establish:** If one of the nodes starts working then the phase goes to the establish phase. In short, we can say that when the node starts communication or carrier is detected then it moves from the dead to the establish phase. - **Authenticate:** It is an optional phase which means that the communication can also moves to the authenticate phase. The phase moves from the establish to the authenticate phase only when both the communicating nodes agree to make the communication authenticated. - **Network:** Once the authentication is successful, the network is established or phase is network. In this phase, the negotiation of network layer protocols take place. - **Open:** After the establishment of the network phase, it moves to the open phase. Here open phase means that the exchange of data takes place. Or we can say that it reaches to the open phase after the configuration of the network layer. - **Terminate:** When all the work is done then the connection gets terminated, and it moves to the terminate phase. On reaching the terminate phase, the link moves to the dead phase which indicates that the carrier is dropped which was earlier created. **There are two more possibilities that can exist in the transition phase:** - The link moves from the authenticate to the terminate phase when the authentication is failed. - The link can also move from the establish to the dead state when the carrier is failed. PPP Stack **In PPP stack, there are three set of protocols:** - **Link Control Protocol (LCP)** The role of LCP is to establish, maintain, configure, and terminate the links. It also provides negotiation mechanism. - **Authentication protocols** There are two types of authentication protocols, i.e., PAP (Password Authenticate protocols), and CHAP (Challenged Handshake Authentication Protocols). **1. PAP (Password Authentication Protocols)** PPP Protocol PAP is less secure as compared to CHAP as in case of PAP protocol, password is sent in the form of a clear text. It is a two-step process. Suppose there are two routers, i.e., router 1 and router 2. In the first step, the router 1 wants to authenticate so it sends the username and password for the authentication. In the second step, if the username and password are matched then the router 2 will authenticate the router 1 otherwise the authentication failed. **2. CHAP (Challenged Handshake Authentication Protocol)** CHAP is a three-step process. Let\'s understand the three steps of CHAP. ![PPP Protocol](media/image4.png) **Step 1:** Suppose there are two routers, i.e., router 1 and router 2. In this step, router 1 sends the username but not the password to the router 2. **Step 2:** The router 2 maintains a database that contains a list of allowed hosts with their login credentials. If no data is found which means that the router 1 is not a valid host to connect with it and the connection gets terminated. If the match is found then the random key is passed. This random key along with the password is passed in the MD5 hashing function, and the hashing function generates the hashed value from the password and the random key (password + random key). The hashed value is also known as Challenge. The challenge along with the random key will be sent to the router 1. **Step 3:** The router 1 receives the hashed value and a random key from the router 2. Then, the router 1 will pass the random key and locally stored password to the MD5 hashing function. The MD5 hashing function generates the hashed value from the combination of random key and password. If the generated hashed value does not match with the received hashed value then the connection gets terminated. If it is matched, then the connection is granted. Based on the above authentication result, the authentication signal that could be either accepted or rejected is sent to the router 2. - **Network Control Protocol (NCP)** After the establishment of the link and authentication, the next step is to connect to the network layer. So, PPP uses another protocol known as network control protocol (NCP). The NCP is a set of protocols that facilitates the encapsulation of data which is coming from the network layer to the PPP frames. Routing ======= - A Router is a process of selecting path along which the data can be transferred from source to the destination. Routing is performed by a special device known as a router. - A Router works at the network layer in the OSI model and internet layer in TCP/IP model - A router is a networking device that forwards the packet based on the information available in the packet header and forwarding table. - The routing algorithms are used for routing the packets. The routing algorithm is nothing but a software responsible for deciding the optimal path through which packet can be transmitted. - The routing protocols use the metric to determine the best path for the packet delivery. The metric is the standard of measurement such as hop count, bandwidth, delay, current load on the path, etc. used by the routing algorithm to determine the optimal path to the destination. - The routing algorithm initializes and maintains the routing table for the process of path determination. **Routing Metrics and Costs** ----------------------------- Routing metrics and costs are used for determining the best route to the destination. The factors used by the protocols to determine the shortest path, these factors are known as a metric. Metrics are the network variables used to determine the best route to the destination. For some protocols use the static metrics means that their value cannot be changed and for some other routing protocols use the dynamic metrics means that their value can be assigned by the system administrator. **The most common metric values are given below:** - **Hop count:** Hop count is defined as a metric that specifies the number of passes through internetworking devices such as a router, a packet must travel in a route to move from source to the destination. If the routing protocol considers the hop as a primary metric value, then the path with the least hop count will be considered as the best path to move from source to the destination. - **Delay:** It is a time taken by the router to process, queue and transmit a datagram to an interface. The protocols use this metric to determine the delay values for all the links along the path end-to-end. The path having the lowest delay value will be considered as the best path. - **Bandwidth:** The capacity of the link is known as a bandwidth of the link. The bandwidth is measured in terms of bits per second. The link that has a higher transfer rate like gigabit is preferred over the link that has the lower capacity like 56 kb. The protocol will determine the bandwidth capacity for all the links along the path, and the overall higher bandwidth will be considered as the best route. - **Load:** Load refers to the degree to which the network resource such as a router or network link is busy. A Load can be calculated in a variety of ways such as CPU utilization, packets processed per second. If the traffic increases, then the load value will also be increased. The load value changes with respect to the change in the traffic. - **Reliability:** Reliability is a metric factor may be composed of a fixed value. It depends on the network links, and its value is measured dynamically. Some networks go down more often than others. After network failure, some network links repaired more easily than other network links. Any reliability factor can be considered for the assignment of reliability ratings, which are generally numeric values assigned by the system administrator. **Types of Routing** -------------------- Routing can be classified into three categories: - Static Routing - Default Routing - Dynamic Routing Routing **Static Routing** ------------------ - Static Routing is also known as Nonadaptive Routing. - It is a technique in which the administrator manually adds the routes in a routing table. - A Router can send the packets for the destination along the route defined by the administrator. - In this technique, routing decisions are not made based on the condition or topology of the networks ### Advantages Of Static Routing Following are the advantages of Static Routing: - **No Overhead:** It has ho overhead on the CPU usage of the router. Therefore, the cheaper router can be used to obtain static routing. - **Bandwidth:** It has not bandwidth usage between the routers. - **Security:** It provides security as the system administrator is allowed only to have control over the routing to a particular network. ### Disadvantages of Static Routing: Following are the disadvantages of Static Routing: - For a large network, it becomes a very difficult task to add each route manually to the routing table. - The system administrator should have a good knowledge of a topology as he has to add each route manually. **Default Routing** ------------------- - Default Routing is a technique in which a router is configured to send all the packets to the same hop device, and it doesn\'t matter whether it belongs to a particular network or not. A Packet is transmitted to the device for which it is configured in default routing. - Default Routing is used when networks deal with the single exit point. - It is also useful when the bulk of transmission networks have to transmit the data to the same hp device. - When a specific route is mentioned in the routing table, the router will choose the specific route rather than the default route. The default route is chosen only when a specific route is not mentioned in the routing table. **Dynamic Routing** ------------------- - It is also known as Adaptive Routing. - It is a technique in which a router adds a new route in the routing table for each packet in response to the changes in the condition or topology of the network. - Dynamic protocols are used to discover the new routes to reach the destination. - In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes. - If any route goes down, then the automatic adjustment will be made to reach the destination. **The Dynamic protocol should have the following features:** - All the routers must have the same dynamic routing protocol in order to exchange the routes. - If the router discovers any change in the condition or topology, then router broadcast this information to all other routers. ### Advantages of Dynamic Routing: - It is easier to configure. - It is more effective in selecting the best route in response to the changes in the condition or topology. ### Disadvantages of Dynamic Routing: - It is more expensive in terms of CPU and bandwidth usage. - It is less secure as compared to default and static routing. **Congestion Control in Computer Networks** A state occurring in network layer when the message traffic is so heavy that it slows down network response time.   **Effects** of Congestion - -   **Congestion control algorithms** - - - - - - - - - Let us consider an example to understand   Imagine a bucket with a small hole in the bottom.No matter at what rate water enters the bucket, the outflow is at constant rate.When the bucket is full with water additional water entering spills over the sides and is lost. ![Leaky Bucket](media/image6.jpeg) Similarly, each network interface contains a leaky bucket and the following **steps** are involved in leaky bucket algorithm: 1. 2. 3. 4. - - - - - - -   **Need** of token bucket Algorithm:-   The leaky bucket algorithm enforces output pattern at the average rate, no matter how bursty the traffic is. So in order to deal with the bursty traffic we need a flexible algorithm so that the data is not lost. One such algorithm is token bucket algorithm.   **Steps** of this algorithm can be described as follows:   1. 2. 3. 4.   Let's understand with an example,   In figure (A) we see a bucket holding three tokens, with five packets waiting to be transmitted. For a packet to be transmitted, it must capture and destroy one token. In figure (B) We see that three of the five packets have gotten through, but the other two are stuck waiting for more tokens to be generated.   **Ways in which token bucket is superior to leaky bucket:** The leaky bucket algorithm controls the rate at which the packets are introduced in the network, but it is very conservative in nature. Some flexibility is introduced in the token bucket algorithm. In the token bucket, algorithm tokens are generated at each tick (up to a certain limit). For an incoming packet to be transmitted, it must capture a token and the transmission takes place at the same rate. Hence some of the busty packets are transmitted at the same rate if tokens are available and thus introduces some amount of flexibility in the system.   **Formula:** M \* s = C + ρ \* s where S -- is time taken M -- Maximum output rate ρ -- Token arrival rate C -- Capacity of the token bucket in byte Let's understand with an example,   image0031 **TCP/IP in Computer Networking** **Introduction :** TCP/IP (Transmission Control Protocol/Internet Protocol) is a suite of communication protocols that define the standards for transmitting data over computer networks, including the internet. The TCP/IP protocol is the foundation of the internet and enables devices to communicate with each other using a common language. The TCP/IP protocol is divided into two layers: the Transport layer and the Internet layer. The Transport layer is responsible for ensuring that data is transmitted reliably from one device to another. This layer is comprised of two protocols: the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP is used for reliable data transmission, while UDP is used for fast transmission of data that can tolerate some packet loss. The Internet layer is responsible for transmitting data packets between devices. This layer is comprised of two protocols: the Internet Protocol (IP) and the Address Resolution Protocol (ARP). IP is responsible for routing data packets between devices, while ARP is used to map IP addresses to physical addresses. TCP/IP also includes a number of application layer protocols that are used to provide services to end-users. These include protocols such as HTTP (Hypertext Transfer Protocol) for web browsing, FTP (File Transfer Protocol) for file transfer, and SMTP (Simple Mail Transfer Protocol) for email. **TCP/IP **stands for **Transmission Control Protocol/ Internet Protocol.** It is a set of conventions or rules and methods that are used to interconnect network devices on the Internet. The internet protocol suite is commonly known as TCP/IP, as the foundational protocols in the suite are Transmission Control Protocol and Internet Protocol. It chooses how the information will be traded over the web through end-to-end communications that incorporate how the information ought to be organized into bundles (bundles of data), addressed, sent, and received at the goal. This communication protocol can also be utilized to interconnect organize devices in a private network such as an intranet or an extranet. **History of TCP/IP:** The Defense Advanced Research Projects Office (DARPA), the investigation department of the U.S. Department of Defense, made the TCP/IP shown in the 1970s for utilization in ARPANET, a wide zone organize that gone before the web. TCP/IP was initially planned for the Unix working framework, and it has been built into all of the working frameworks that came after it. **Characteristics of TCP/IP:** - - - - - - - - - - - - **TCP/IP Layers** - - - - **How TCP/ IP works?** - - - - **Application/Uses of TCP/IP** Some Real-Time Applications are: - - - - - - - **Benefits of TCP/IP** - - - - - **Challenges of TCP/IP:** - - - - - - - - - - - What is IP? Here, IP stands for **internet protocol**. It is a protocol defined in the TCP/IP model used for sending the packets from source to destination. The main task of IP is to deliver the packets from source to the destination based on the IP addresses available in the packet headers. IP defines the packet structure that hides the data which is to be delivered as well as the addressing method that labels the datagram with a source and destination information. An IP protocol provides the connectionless service, which is accompanied by two transport protocols, i.e., [TCP/IP](https://www.javatpoint.com/tcp-ip-full-form) and UDP/IP, so internet protocol is also known as [TCP/IP](https://www.javatpoint.com/computer-network-tcp-ip-model) or [UDP](https://www.javatpoint.com/udp-full-form)/IP. The first version of IP (Internet Protocol) was IPv4. After IPv4, IPv6 came into the market, which has been increasingly used on the public internet since 2006. History of Internet Protocol The development of the protocol gets started in 1974 by **Bob Kahn and Vint Cerf**. It is used in conjunction with the Transmission Control Protocol (TCP), so they together named the [TCP/IP](https://www.javatpoint.com/tcp-ip-full-form). The first major version of the internet protocol was IPv4, which was version 4. This protocol was officially declared in RFC 791 by the Internet Engineering Task Force (IETF) in 1981. After IPv4, the second major version of the internet protocol was IPv6, which was version 6. It was officially declared by the IETF in 1998. The main reason behind the development of IPv6 was to replace IPv4. There is a big difference between IPv4 and IPv6 is that IPv4 uses 32 bits for addressing, while IPv6 uses 128 bits for addressing. Function The main function of the internet protocol is to provide addressing to the hosts, encapsulating the data into a packet structure, and routing the data from source to the destination across one or more [IP](https://www.javatpoint.com/ip-full-form) networks. In order to achieve these functionalities, [internet](https://www.javatpoint.com/internet) protocol provides two major things which are given below. **An internet protocol defines two things:** - Format of IP packet - IP Addressing system What is an IP packet? Before an IP packet is sent over the network, two major components are added in an IP packet, i.e., **header** and a **payload**. ![IP](media/image8.png) An IP header contains lots of information about the IP packet which includes: - Source IP address: The source is the one who is sending the data. - Destination IP address: The destination is a host that receives the data from the sender. - Header length - Packet length - TTL (Time to Live): The number of hops occurs before the packet gets discarded. - Transport protocol: The transport protocol used by the internet protocol, either it can be TCP or UDP. There is a total of 14 fields exist in the IP header, and one of them is optional. **Payload:** Payload is the data that is to be transported. How does the IP routing perform? IP routing is a process of determining the path for data so that it can travel from the source to the destination. As we know that the data is divided into multiple packets, and each packet will pass through a web of the router until it reaches the final destination. The path that the data packet follows is determined by the routing algorithm. The routing algorithm considers various factors like the size of the packet and its header to determine the efficient route for the data from the source to the destination. When the data packet reaches some router, then the source address and destination address are used with a routing table to determine the next hop\'s address. This process goes on until it reaches the destination. The data is divided into multiple packets so all the packets will travel individually to reach the destination. **For example**, when an email is sent from the email server, then the TCP layer in this email server divides the data into multiple packets, provides numbering to these packets and transmits them to the IP layer. This IP layer further transmits the packet to the destination email server. On the side of the destination server, the IP layer transmits these data packets to the TCP layer, and the TCP layer recombines these data packets into the message. The message is sent to the email application. What is IP Addressing? An IP address is a unique identifier assigned to the computer which is connected to the internet. Each IP address consists of a series of characters like 192.168.1.2. Users cannot access the domain name of each website with the help of these characters, so DNS resolvers are used that convert the human-readable domain names into a series of characters. Each IP packet contains two addresses, i.e., the IP address of the device, which is sending the packet, and the IP address of the device which is receiving the packet. **Types of IP addresses** IPv4 addresses are divided into two categories: - **Public address** - **Private address** Public address The public address is also known as an external address as they are grouped under the WAN addresses. We can also define the public address as a way to communicate outside the network. This address is used to access the internet. The public address available on our computer provides the remote access to our computer. With the help of a public address, we can set up the home server to access the internet. This address is generally assigned by the ISP (Internet Service Provider). **Key points related to public address are:** - The scope of the public address is global, which means that we can communicate outside the network. - This address is assigned by the ISP (Internet Service Provider). - It is not available at free of cost. - We can get the Public IP by typing on Google \"What is my IP\". Private address A private address is also known as an internal address, as it is grouped under the LAN addresses. It is used to communicate within the network. These addresses are not routed on the internet so that no traffic can come from the internet to this private address. The address space for the private address is allocated using **InterNIC** to create our own network. The private addresses are assigned to mainly those computers, printers, smartphones, which are kept inside the home or the computers that are kept within the organization. For example, a private address is assigned to the printer, which is kept inside our home, so that our family member can take out the print from the printer. If the computer is assigned with a private address, then the devices available within the local network can view the computer through the private ip address. However, the devices available outside the local network cannot view the computer through the private IP address, but they can access the computer if they know the router\'s public address. To access the computer directly, NAT (Network Address Translator) is to be used. **Key points related to private address are:** - Its scope is local, as we can communicate within the network only. - It is generally used for creating a local area network. - It is available at free of cost. - We can get to know the private IP address by simply typing the \"ipconfig\" on the command prompt. IP address ========== IP address An IP address represents a unique address that distinguishes any device on the internet or any network from another. IP or Internet Protocol defines the set of commands directing the setup of data transferred through the internet or any other local network. An [IP](https://www.javatpoint.com/ip-full-form) address is the identifier that enables your device to send or receive data packets across the internet. It holds information related to your location and therefore making devices available for two-way communication. The internet requires a process to distinguish between different networks, routers, and websites. Therefore, IP addresses provide the mechanism of doing so, and it forms an indispensable part in the working of the internet. You will notice that most of the IP addresses are essentially numerical. Still, as the world is witnessing a colossal growth of network users, the network developers had to add letters and some addresses as internet usage grows. An IP address is represented by a series of numbers segregated by periods(.). They are expressed in the form of four pairs - an example address might be 255.255.255.255 wherein each set can range from 0 to 255. [IP](https://www.javatpoint.com/ip) addresses are not produced randomly. They are generated mathematically and are further assigned by the IANA (Internet Assigned Numbers Authority), a department of the ICANN. ICANN stands for Internet Corporation for Assigned Names and Numbers. It is a non-profit corporation founded in the US back in 1998 with an aim to manage Internet security and enable it to be available by all. **How do IP addresses work?** ----------------------------- Sometimes your device doesn\'t connect to your network the way you expect it to be, or you wish to troubleshoot why your network is not operating correctly. To answer the above questions, it is vital to learn the process with which IP addresses work. Internet Protocol or IP runs the same manner as other languages, i.e., applying the set guidelines to communicate the information. All devices obtain, send, and pass information with other associated devices with the help of this protocol only. By using the same language, the computers placed anywhere can communicate with one another. **The process of IP address works in the following way:** 1. Your computer, smartphone, or any other Wi-Fi-enabled device firstly connects to a network that is further connected to the internet. The network is responsible for giving your device access to the internet. 2. While working from home, your device would be probably using that network provided by your Internet Service Provider (ISP). In a professional environment, your device uses your company network. 3. Your ISP is responsible to generate the IP address for your device. 4. Your internet request penetrates through the ISP, and they place the requested data back to your device using your IP address. Since they provide you access to the internet, ISP\'s are responsible for allocating an IP address to your computer or respective device. 5. Your IP address is never consistent and can change if there occurs any changes in its internal environment. For instance, if you turn your modem or router on or off, it will change your IP address. Or the user can also connect the ISP to change their IP address. 6. When you are out of your home or office, mainly if you travel and carry your device with you, your computer won\'t be accessing your home IP address anymore. This is because you will be accessing the different networks (your phone hotspot, Wi-Fi at a cafe, resort, or airport, etc.) to connect the device with the internet. Therefore, your device will be allocated a different (temporary) IP address by the ISP of the hotel or cafe. **Types of IP addresses** ------------------------- There are various classifications of IP addresses, and each category further contains some types. ### Consumer IP addresses Every individual or firm with an active internet service system pursues two types of IP addresses, i.e., Private IP (Internet Protocol) addresses and public IP (Internet Protocol) addresses. The public and private correlate to the network area. Therefore, a private IP address is practiced inside a network, whereas the other (public IP address) is practiced outside a network. **1. Private IP addresses** All the devices that are linked with your internet network are allocated a private IP address. It holds computers, desktops, laptops, smartphones, tablets, or even Wi-Fi-enabled gadgets such as speakers, printers, or smart Televisions. With the expansion of IoT (internet of things), the demand for private IP addresses at individual homes is also seemingly growing. However, the router requires a method to identify these things distinctly. Therefore, your router produces unique private IP addresses that act as an identifier for every device using your internet network. Thus, differentiating them from one another on the network. **2. Public IP addresses** A public IP address or primary address represents the whole network of devices associated with it. Every device included within with your primary address contains their own private IP address. ISP is responsible to provide your public IP address to your router. Typically, ISPs contains the bulk stock of IP addresses that they dispense to their clients. Your public IP address is practiced by every device to identify your network that is residing outside your internet network. Public IP addresses are further classified into two categories- dynamic and static. - **Dynamic IP addresses**\ As the name suggests, Dynamic IP addresses change automatically and frequently. With this types of IP address, ISPs already purchase a bulk stock of IP addresses and allocate them in some order to their customers. Periodically, they re-allocate the IP addresses and place the used ones back into the IP addresses pool so they can be used later for another client. The foundation for this method is to make cost savings profits for the ISP. - **Static IP addresses**\ In comparison to dynamic IP addresses, static addresses are constant in nature. The network assigns the IP address to the device only once and, it remains consistent. Though most firms or individuals do not prefer to have a static IP address, it is essential to have a static IP address for an organization that wants to host its network server. It protects websites and email addresses linked with it with a constant IP address. ### Types of website IP addresses The following classification is segregated into the two types of website IP addresses i.e., shared and dedicated. **1. Shared IP addresses** Many startups or individual website makers or various SME websites who don\'t want to invest initially in dedicated IP addresses can opt for shared hosting plans. Various web hosting providers are there in the market providing shared hosting services where two or more websites are hosted on the same server. Shared hosting is only feasible for websites that receive average traffic, the volumes are manageable, and the websites themselves are confined in terms of the webpages, etc. **2. Dedicated IP addresses** Web hosting providers also provide the option to acquire a dedicated IP address. Undoubtedly dedicated IP addresses are more secure, and they permit the users to run their File Transfer Protocol (FTP) server. Therefore, it is easier to share and transfer data with many people within a business, and it also provides the option of anonymous FTP sharing. Another advantage of a dedicated IP addresses it the user can easily access the website using the IP address rather than typing the full domain name. **How to search for IP addresses** ---------------------------------- The easiest method to find the public IP address of your router is to type \"What is my IP address?\" on Google.com. Google will immediately display the results on the screen. There are some third-party websites available on the internet that also provides the same information. Those websites can access your public IP address because your router has requested to access their information by visiting their website. Below are the steps to find your private IP address in two commonly used platforms: **In Windows:** 1. Open the command prompt by typing the term \'cmd\' (no quote marks) in the Windows search panel. 2. The following window will appear. Type \"ipconfig\" (without the quotes) to access the private IP address information.\ ![IP address](media/image10.png) 3. It will display the following information.\ IP address **On a Mac:** 1. Go to System Preferences 2. Click on the network option.\ ![IP address](media/image12.png) 3. It will display the information regarding your private IP address.\ IP address **IP address security threats** ------------------------------- Cybercriminals or digital crackers various ways to hack your IP address. The two commonly used techniques include social engineering and online stalking. ### Social engineering Hackers can practice social engineering techniques to trick you into disclosing your device\'s IP address. For example, they will connect you through email, Skype, or a similar instantaneous messaging app, that accepts IP addresses to communicate and pass information. If you chat with these anonymous people using these messaging applications, it is essential to note that they can get your IP address. Cybercriminals can use a third-party tool named Skype Resolver, with the help of which they can locate your IP address using your username. ### Online stalking Attackers can get crack your IP address by simply tracking your online activities. Any online activity can disclose your IP address, i.e., from using an instant messaging app to playing online games to discussing a topic on any digital websites and forums. Once they gain access to your IP address, criminals can visit an IP address tracking website (whatismyipaddress.com), they will enter your IP address there, and in no seconds, they can track your current location. They won\'t stop till this; they can further cross-check it with other available information to verify whether the IP address is connected with you particularly. Social networking sites such as instagram, LinkedIn, facebook are used to verify the information of your location gathered by the attacker. Internet Protocol version 6 (IPv6) ================================== IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the problem of IPv4 exhaustion. IPv6 is a 128-bits address having an address space of 2^128^, which is way bigger than IPv4. IPv6 use Hexa-Decimal format separated by colon (:). ### Components in Address format :    1. 2. 3. ![https://media.geeksforgeeks.org/wp-content/uploads/ipv6-1-2-1024x284.png](media/image14.png) Need for IPv6: -------------- The Main reason of IPv6 was the address depletion as the need for electronic devices rose quickly when [Internet Of Things (IOT)](https://www.geeksforgeeks.org/introduction-to-internet-of-things-iot-set-1/) came into picture after the 1980s & other reasons are related to the slowness of the process due to some unnecessary processing, the need for new options, support for multimedia, and the desperate need for security. IPv6 protocol responds to the above issues using the following main changes in the protocol: #### 1. Large address space An IPv6 address is 128 bits long.compared with the 32 bit address of IPv4, this is a huge(2 raised 96 times) increases in the address space. #### 2. Better header format IPv6 uses a new  header format in which options are separated from the base header and inserted, when needed, between the base header and the upper layer data. This simplifies and speeds up the routing process because most of the options do not need to be checked by routers. #### 3. New options IPv6 has new options to allow for additional functionalities. #### 4. Allowance for extension IPv6 is designed to allow the extension of the protocol if required by new technologies or applications. #### 5. Support for resource allocation In IPv6,the type of service field has been removed, but two new fields , traffic class and flow label have been added to enables the source to request special handling of the packet. this mechanism can be used to support traffic such as real-time audio and video. #### 6. Support for more security The encryption and authentication options in IPv6 provide confidentiality and integrity of the packet. In IPv6 representation, we have three addressing methods :  - - - Addressing methods ------------------ ***1. Unicast Address ***\ Unicast Address identifies a single network interface. A packet sent to a unicast address is delivered to the interface identified by that address.  ***2. Multicast Address ***\ [Multicast](https://www.geeksforgeeks.org/multicasting-in-computer-network/) Address is used by multiple hosts, called as **groups**, acquires a multicast destination address. These hosts need not be geographically together. If any packet is sent to this multicast address, it will be distributed to all interfaces corresponding to that multicast address. And every node is configured in the same way. In simple words, one data packet is sent to multiple destinations simultaneously. ***3. Anycast Address ***\ Anycast Address is assigned to a group of interfaces. Any packet sent to an anycast address will be delivered to only one member interface (mostly nearest host possible).  **Note:** Broadcast is not defined in IPv6.  **Types of IPv6 address:**\ We have 128 bits in IPv6 address but by looking at the first few bits we can identify what type of address it is.    **Prefix** **Allocation** **Fraction of Address Space** -------------- ------------------------------ ------------------------------- 0000 0000 Reserved 1/256 0000 0001 Unassigned (UA) 1/256 0000 001 Reserved for NSAP 1/128 0000 01 UA 1/64 0000 1 UA 1/32 0001 UA 1/16 001 Global Unicast 1/8 010 UA 1/8 011 UA 1/8 100 UA 1/8 101 UA 1/8 110 UA 1/8 1110 UA 1/16 1111 0 UA 1/32 1111 10 UA 1/64 1111 110 UA 1/128 1111 1110 0 UA 1/512 1111 1110 10 Link-Local Unicast Addresses 1/1024 1111 1110 11 Site-Local Unicast Addresses 1/1024 1111 1111 Multicast Address 1/256 **Note: **In IPv6, all 0's and all 1's can be assigned to any host, there is not any restriction like IPv4.  **Provider-based Unicast address :** \ These are used for global communication. \   https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_2.png\ The First 3 bits identify it as of this type. \ **Registry Id (5-bits):** Registry Id identifies the region to which it belongs. Out of 32 (i.e. 2\^5), only 4 registry IDs are being used.  ![https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_4.png](media/image16.png) **Provider Id:** Depending on the number of service providers that operate under a region, certain bits will be allocated to the Provider Id field. This field need not be fixed. Let's say if Provider Id = 10 bits then Subscriber Id will be 56 -- 10 = 46 bits. \ **Subscriber Id:** After Provider Id is fixed, the remaining part can be used by ISP as a normal IP address. \ **Intra Subscriber:** This part can be modified as per the need of the organization that is using the service.  **Geography based Unicast address :** \   https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_5.png **Global routing prefix:** Global routing prefix contains all the details of Latitude and Longitude. As of now, it is not being used. In Geography-based Unicast address routing will be based on location. \ **Interface Id:** In IPv6, instead of using Host Id, we use the term Interface Id.  **Some special addresses:** \ **Unspecified** ### ![https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_6.png](media/image18.png) **Loopback** ### https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_7.png **IPv4 Compatible ** ### ![https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_8.png](media/image20.png) **IPv4 mapped** #### https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_9.png ** ** Local Unicast Addresses : \ These are of two types: ***Link-local*** and ***Site-Local*** ### **1. Link-local address:**   ![https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_10.png](media/image22.png) A link-local address is used for addressing a single link. It can also be used to communicate with nodes on the same link. The link-local address always begins with 1111111010 (i.e. FE80). The router will not forward any packet with Link-local address. \   **2. Site local address: \  **https://media.geeksforgeeks.org/wp-content/uploads/IP\_v6\_11.png Site local addresses are equivalent to a private IP address in IPv4. Likely, some address space is reserved, which can only be routed within an organization. The first 10-bits are set to 1111111011, which is why Site local addresses always begin with FEC0. The following 32 bits are Subnet IDs, which can be used to create a subnet within the organization. The node address is used to uniquely identify the link; therefore, we use a 48-bits MAC address here. \   Advantages of IPv6 : -------------------- **1. Realtime Data Transmission : **Realtime data transmission refers to the process of transmitting data in a very fast manner or **immediately**. Example : Live streaming services such as cricket matches, or other tournament that are streamed on web exactly as soon as it happens with a maximum delay of 5-6 seconds.  ** ** **2. IPv6 supports authentication: **Verifying that the data received by the receiver from the sender is exactly what the sender sent and came through the sender only not from any third party. Example : Matching the hash value of both the messages for verification is also done by IPv6. **3. IPv6 performs Encryption:** Ipv6  can encrypt the message at network layer even if the protocols of application layer at user level didn't encrypt the message which is a major advantage as it takes care of encryption. **4. Faster processing at Router: **Routers are able to process data packets of Ipv6 much faster due to smaller **Base header** of fixed size -- 40 bytes which helps in decreasing processing time resulting in more efficient packet transmission. Whereas in Ipv4, we have to calculate the length of header which lies between 20-60 bytes.

Use Quizgecko on...
Browser
Browser