LESSON 2 & 3.pdf
Document Details
Uploaded by TrustworthyObsidian6787
Tags
Full Transcript
OSI Model vs. TCP/IP Model LESSON 2 The OSI Model The Open Systems Interconnection (OSI) model is a conceptual framework that describes networking or telecommunications systems as seven layers, each with its own function. The layers help network pros visualize what is going on within the...
OSI Model vs. TCP/IP Model LESSON 2 The OSI Model The Open Systems Interconnection (OSI) model is a conceptual framework that describes networking or telecommunications systems as seven layers, each with its own function. The layers help network pros visualize what is going on within their networks and can help network managers narrow down problems (is it a physical issue or something with the application?), as well as computer programmers (when developing an application, which other layers does it need to work with?). Tech vendors selling new products will often refer to the OSI model to help customers understand which layer their products work with or whether it works “across the stack”. https://www.networkworld.com/article/3239677/the-osi-model-explained-and-how-to-easily-remember-its-7-layers.html The OSI Model The Open Systems Interconnection (OSI) model describes seven layers that computer systems use to communicate over a network. It was the first standard model for network communications, adopted by all major computer and telecommunication companies in the early 1980s The modern Internet is not based on OSI, but on the simpler TCP/IP model. However, the OSI 7-layer model is still widely used, as it helps visualize and communicate how networks operate, and helps isolate and troubleshoot networking problems. OSI was introduced in 1983 by representatives of the major computer and telecom companies, and was adopted by ISO as an international standard in 1984. https://www.imperva.com/learn/application-security/osi-model/ The 7 Layers of OSI Model Layer 7 – Application Layer The application layer is used by end-user software such as web browsers (Google Chrome, Firefox, Safari, etc.) and email clients. It provides protocols that allow software to send and receive information and present meaningful data to users. A few examples of application layer protocols are the Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and Domain Name System (DNS). The 7 Layers of OSI Model Layer 6 – Presentation Layer The presentation layer prepares data for the application layer. It defines how two devices should encode, encrypt, and compress data so it is received correctly on the other end. The presentation layer takes any data transmitted by the application layer and prepares it for transmission over the session layer. A good example of this is encryption and decryption of data for secure transmission; this happens at Layer 6. The 7 Layers of OSI Model Layer 6 – Presentation Layer Encryption is the process by which a readable message is converted to an unreadable (meaningless) form to prevent unauthorized parties from reading it. Decryption is the process of converting an encrypted message back to its original (readable) format. The original message is called the plaintext message. The encrypted message is called the ciphertext message. The 7 Layers of OSI Model Layer 5 – Session Layer The session layer creates communication channels, called sessions, between devices. It is responsible for opening sessions, ensuring they remain open and functional while data is being transferred, and closing them when communication ends. The session layer can also set checkpoints during a data transfer—if the session is interrupted, devices can resume data transfer from the last checkpoint. The 7 Layers of OSI Model Layer 4 – Transport Layer The transport layer takes data transferred in the session layer and breaks it into “segments” on the transmitting end. It is responsible for reassembling the segments on the receiving end, turning it back into data that can be used by the session layer. The transport layer carries out flow control, sending data at a rate that matches the connection speed of the receiving device, and error control, checking if data was received incorrectly and if not, requesting it again. The 7 Layers of OSI Model Layer 3 – Network Layer The network layer has two main functions. One is breaking up segments into network packets, and reassembling the packets on the receiving end. The other is routing packets by discovering the best path across a physical network. The network layer uses network addresses (typically Internet Protocol addresses) to route packets to a destination node. The 7 Layers of OSI Model Layer 2 – Data Link Layer The data link layer establishes and terminates a connection between two physically-connected nodes on a network. It breaks up packets into frames and sends them from source to destination. This layer is composed of two parts—Logical Link Control (LLC), which identifies network protocols, performs error checking and synchronizes frames, and Media Access Control (MAC) which uses MAC addresses to connect devices and define permissions to transmit and receive data. The 7 Layers of OSI Model Layer 1 – Physical Layer At the bottom of our OSI model we have the Physical Layer, which represents the electrical and physical representation of the system. This can include everything from the cable type, radio frequency link (as in a Wi-Fi network), as well as the layout of pins, voltages, and other physical requirements. When a networking problem occurs, many networking pros go right to the physical layer to check that all of the cables are properly connected and that the power plug hasn’t been pulled from the router, switch or computer, for example. The 7 Layers of OSI Model Layer 1 – Physical Layer The physical layer is responsible for the physical cable or wireless connection between network nodes. It defines the connector, the electrical cable or wireless technology connecting the devices, and is responsible for transmission of the raw data, which is simply a series of 0s and 1s, while taking care of bit rate control. The 7 Layers of OSI Model https://www.youtube.com/watch?v=Ilk7UXzV_Qc The OSI Model Advantages of OSI Model The OSI model helps users and operators of computer networks: Determine the required hardware and software to build their network. Understand and communicate the process followed by components communicating across a network. Perform troubleshooting, by identifying which network layer is causing an issue and focusing efforts on that layer. The OSI Model Advantages of OSI Model The OSI model helps network device manufacturers and networking software vendors: Create devices and software that can communicate with products from any other vendor, allowing open interoperability Define which parts of the network their products should work with. Communicate to users at which network layers their product operates – for example, only at the application layer, or across the stack. TCP/IP The Transmission Control Protocol (TCP) is the internet standard ensuring the successful exchange of data packets between devices over a network. TCP is the underlying communication protocol for a wide variety of applications, including web servers and websites, email applications, FTP and peer- to-peer apps. TCP/IP TCP operates with the internet protocol (IP) to specify how data is exchanged online. IP is responsible for sending each packet to its destination, while TCP guarantees that bytes are transmitted in the order in which they were sent with no errors or omissions. Together, the two protocols are referred to as TCP/IP. The OSI Model vs. TCP/IP Model The Transfer Control Protocol/Internet Protocol (TCP/IP) is older than the OSI model and was created by the US Department of Defense (DoD). A key difference between the models is that TCP/IP is simpler, collapsing several OSI layers into one: OSI layers 5, 6, 7 are combined into one Application Layer in TCP/IP OSI layers 1, 2 are combined into one Network Access Layer in TCP/IP – however TCP/IP does not take responsibility for sequencing and acknowledgement functions, leaving these to the underlying transport layer. The OSI Model vs. TCP/IP Model The OSI Model vs. TCP/IP Model Other important differences: TCP/IP is a functional model designed to solve specific communication problems, and which is based on specific, standard protocols. OSI is a generic, protocol-independent model intended to describe all forms of network communication. In TCP/IP, most applications use all the layers, while in OSI simple applications do not use all seven layers. Only layers 1, 2 and 3 are mandatory to enable any data communication. END OF LESSON 2 IP and IP Addresses What is IP? Internet Protocol (IP) is a set of governing rules for data packets, data format, or datagram sent through a local network or the internet. It is a connectionless and datagram-oriented protocol as it works on a dynamic computer network. An IP works without a centralized monitor or directory and never relies on a node or link. Hence, each data packet must have the source and destination’s IP address and other key information to get delivered successfully. What is an IP Address? An Internet Protocol Address (IP address) refers to a unique address or numerical label designated for each device connected in a computer network using the Internet Protocol (IP) for communication. Example of an IP address: 192.16.2.1 What is an IP Address? Simply put, IP addresses identify a device on a local network or the internet and allow data to be transmitted between the devices, containing location information while making devices accessible for easy communication. IP addresses offer a great way of differentiating between different devices like computers, printers, websites, routers, etc. What is an IP Address? An IP address is used for two purposes: Location finding Identifying host/network interface The Internet Assigned Numbers Authority (IANA) manages IP addresses globally. And, 5 Regional Internet Registries (RIRs) manage them in designated regions and assign them to local internet registries like end-users and Internet Service Providers (ISPs). What is an IP Address? How Does An IP Address Work? An IP address works in the same way as your house address does for you. If you want to receive a letter or a parcel from a courier, you need to give the sender your house address. Similarly, if you want to receive electronic mail or data from the web, your connected device or computer needs to have an internet address so that the sender can identify it and send the data. What is an IP Address? How Does An IP Address Work? Whether it is your computer, tablet, smartphone, smart lights, thermostat, baby monitor, or anything else connected to the internet, every device has to have an internet number or address to establish a connection and communicate with other devices using a set of guidelines or protocols. What is an IP Address? How Does An IP Address Work? This is why every site like Amazon or Netflix also consists of an IP address to communicate with you and send the information you requested. However, they keep a name instead of their IP address, for example, Amazon.com and Netflix.com, to help you find them easily. Otherwise, you had to type this long set of numbers for every site you visit. Names are easier to remember than numbers. What is an IP Address? How Does An IP Address Work? Now, you may ask how IP addresses are allocated to each device. An IP address is not random; it is produced mathematically and allocated by the IANA. In the above example of an IP address – 192.16.2.1, you can see that it is represented as a set of 4 numbers separated by a period. Each number can range from 0 to 255 in this set. So, the full range of IP addresses can go from 0.0.0.0 to 255.255.255.255. Types of IP Addresses 1. Private IP Address and Public IP Address A business or individual having an internet service has IP addresses of two types: private and public. These IP addresses are based on the network location. Types of IP Addresses 1. Private IP Address and Public IP Address Private IP Address: It is used inside the computer network within your home or office. Every device (computer, smartphone, speakers, smart TV, etc.) connecting to your network consists of a private IP address assigned by your router. Types of IP Addresses 1. Private IP Address and Public IP Address As the usage of different devices is growing, the number of IP addresses at home grows with it. Hence, your router must find a way to detect these systems separately, which is why it generates unique private IP addresses for each of them, differentiating devices on your network. Devices outside the private network will not be able to access the private IP addresses. Types of IP Addresses 1. Private IP Address and Public IP Address Public IP address: It is used outside your home or office computer network. Each device connected to the public network or internet will have its IP address assigned by the Internet Service Provider (ISP). ISPs have a wide range of IP addresses for customers, and they allocate a public IP address to your router. Types of IP Addresses 1. Private IP Address and Public IP Address External devices use public IP addresses to find your device over the internet. A public IP address is of two types: static and dynamic. Types of IP Addresses 2. Static IP Address and Dynamic IP Address Static IP addresses: They are consistent and don’t change regularly or automatically. Once the ISP assigns it, the IP stays the same. Types of IP Addresses 2. Static IP Address and Dynamic IP Address Every business or individual does not need a static IP address. But if you want to host your own server, you must have a static IP address. It ensures your email address and sites tied to a static IP address have the same IP consistently. As a result, external devices can find you easily on the internet. Types of IP Addresses 2. Static IP Address and Dynamic IP Address Dynamic IP address: These IP addresses change regularly and automatically, unlike static addresses. ISPs have a pool of unassigned IP addresses, which they assign to customers who sign in to their internet service. A customer uses the assigned IP address as long as they are connected to the internet. When the customer stops using the service or disconnects from the internet, the assigned IP address becomes free and returns to the pool of unassigned IP addresses. These dynamic addresses are re-assigned to other customers. Types of IP Addresses 2. Static IP Address and Dynamic IP Address This approach saves ISPs costs, and they don’t need to perform specific tasks to re-establish a user’s IP address time and again. In addition, it also ensures security as changing IP addresses makes it difficult for hackers to zero in on one user. We have earlier discussed static IP addresses for businesses wanting to own a server for their sites. Similarly, there are website IP addresses of two types as well: Shared and Dedicated IP Address. Types of IP Addresses 3. Shared IP Address and Dedicated IP Address Shared IP address: Website owners relying on a shared hosting service from a web host will get a server shared by other sites. It is suitable for small-scale businesses, bloggers, portfolio sites, etc., where traffic is less. They will have a shared IP address. Types of IP Addresses 3. Shared IP Address and Dedicated IP Address Dedicated IP addresses: Larger sites are looking for a more secure option, and pro gamers who want better control over their servers can go for dedicated hosting plans. They can buy a dedicated IP address. Types of IP Addresses 3. Logical IP Address and Physical IP Address Logical IP address: It is assigned by the software inside a server or router and may or may not change periodically. For instance, your laptop can have a different IP address if you connect it to another hotspot. Types of IP Addresses 3. Logical IP Address and Physical IP Address Physical IP address: Every hardware unit is built with a unique IP address that never changes. This is a physical IP address. You can use a resolution protocol to convert a logical IP address to a physical one to identify a device in your IP network. IP Versions: IPv4 and IPv6 Internet Protocol Version 4 (IPv4) The original IP version deployed in the Advanced Research Projects Agency Network (ARPANET) for the first time in 1983 was IPv4. It is used widely in many corporations. Due to its prevalence, the terminology “IP address” still commonly refers to those addresses that IPv4 defines. IP Versions: IPv4 and IPv6 Internet Protocol Version 4 (IPv4) IPv4 represents an IP address in the form of a 32- bit number, consisting of 4 numbers separated by periods. Each number represents a decimal (base- 10) for an 8-digit binary number (base-2) or octet. As explained earlier, each of the 4 numbers in an IPv4 address ranges from 0-255. Example: 172.16.254.1, 192.16.2.1, 192.26.254.1, 172.0.16.0, etc. IP Versions: IPv4 and IPv6 Internet Protocol Version 4 (IPv4) IP Versions: IPv4 and IPv6 Internet Protocol Version 6 (IPv6) Due to the tremendous growth of the web, IPv4 addresses started depleting around the 1990s. As a result, the scarcity of IP address space became grave to assign them to the ISPs and end-users. IP Versions: IPv4 and IPv6 Internet Protocol Version 6 (IPv6) This pressurized the Internet Engineering Task Force (IETF) to innovate and explore technologies to extend the internet’s address capability. They eventually redesigned the IP as IPv6 in 1995. It went through a series of testing until the 2000s when its commercial deployment began. IP Versions: IPv4 and IPv6 Internet Protocol Version 6 (IPv6) In IPv6, the address space was increased to 128 bits or 16 octets (from 32 bits or 8 octets in IPv4). IPv6 is represented by 8 sets of 4 hexadecimal digits, where each number set is separated with the help of a colon and may contain letters and digits. Example: 2001:0DB8:AC10:0000:0011:AAAA:2C4A:FE01 IP Versions: IPv4 and IPv6 You may ask why IP versions 4 and 6, where are others between and after them? In reality, other versions were defined, from versions 1 to 9, but only versions 4 and 6 found widespread use. Version 1 and 2 were TCP protocol names in 1974 and ’77 to separate the IP specification at that time. Moreover, version 3 was introduced in 1978, where v3.1 was the first ever version in which TCP got separated from IP. Next, version 5 that surfaced in 1979 was the experimental protocol – Internet Stream Protocol. IPv6 is a combination of various versions – v6, v7, v8, and v9. IP Addressing Scheme (IPv4) The IPv4 Addressing Scheme An IP address is an address used in order to uniquely identify a device on an IP network. The IPv4 address is made up of 32 bits, which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary. The IPv4 Addressing Scheme Here is how binary octets convert to decimal: The right most bit, or least significant bit, of an octet holds a value of 20. The bit just to the left of that holds a value of 21. This continues until the left-most bit, or most significant bit, which holds a value of 27. So if all binary bits are a one, the decimal equivalent would be 255 as shown here: The IPv4 Addressing Scheme Here is a sample octet conversion when not all of the bits are set to 1. The IPv4 Addressing Scheme And this sample shows an IP address represented in both binary and decimal. These octets are broken down to provide an addressing scheme that can accommodate large and small networks. The IPv4 Addressing Scheme To convert a decimal IPv4address to binary use the positional chart and check first if the number is greater than the 128 bit. If no, a 0 is placed in this position. If yes, then a 1 is placed in this position. 128 is subtracted from the original number and the remainder is then checked against the next position (64) If it is less than 64, a 0 is placed in this position. If it is greater, a 1 is placed in this position and 64 is subtracted. The process repeats until all positional values have been entered. IP Address Classes (IPv4) Here, we are going to discuss the different classes & ranges of IP addresses and how these are defined. These classes are defined on the basis of different combinations of first 8 bits (First octet) out of the total 32 bits of IP address. Following are the different classes of IP addresses and the corresponding range. IP Address Classes (IPv4) CLASS A In this class, out of 32 bits only first 8 bits are assigned to the network part, hence it has default subnet mask of 255.0.0.0. In this class the first bit is reserved and is always kept off. IP Address Classes (IPv4) CLASS A Lower range can be found out by keeping all the bits off (means the corresponding numerical value is not added): Higher range can be calculated by turning all the bits on (except the 1st bit which is reserved as off): IP Address Classes (IPv4) CLASS A Hence, the IP range of this class should be 0-127 in the first octet but 0.0.0.0 doesn’t represent a valid network and 127.0.0.0 to 127.255.255.255 is reserved for local host loop back to verify TCP/IP services diagnostic functions. So the Valid IP range for class A is 1-126. Some examples are 10.x.x.x, 125.x.x.x, 79.x.x.x, 98.x.x.x etc. IP Address Classes (IPv4) CLASS B In this class, first 16 bits are assigned to network part & so it has default subnet mask of 255.255.0.0. For range assignment first two bits are reserved, first bit always on and second bit always off. IP Address Classes (IPv4) CLASS B Its lower range is 128 as last six bits are off: Its higher range is 191 as last six bits are on: IP Address Classes (IPv4) CLASS B So the range of class B is 128-191. Some examples are 130.x.x.x, 156.x.x.x, 178.x.x.x, 190.x.x.x. Note: – In class B the range 169.254.0.0 - 169.254.255.255 is reserved for APIPA (Automatic private IP addressing) and used when a computer doesn’t get any IP from DHCP server for various reasons. IP Address Classes (IPv4) CLASS C This class has 24 bits for network part and so its default subnet mask is 255.255.255.0. To assign the range, first 3 bits are reserved, 1st & 2nd bits are always on and 3rd bit is always off. IP Address Classes (IPv4) CLASS C Its lower range is 192 as last five bits are off: Its higher range is 223 by putting last five bits on: So the class C range is 192-223. Some examples are 200.x.x.x, 215.x.x.x, 221.x.x.x, 195.x.x.x. IP Address Classes (IPv4) CLASS D The range of this class is from 224-239 and can’t be allocated to hosts. This class is used for multicasting by various routing protocols. Some common examples are: 224.0.0.5-Used by all OSPF routers 224.0.0.6-Used by OSPF DRs (Designated Routers) 224.0.0.9-Used by RIP-2 224.0.0.10-Used by EIGRP 224.0.0.12-Used by DHCP Server/Relay Agent 224.0.0.14-Used by RSVP encapsulation 224.0.0.18-Used by VRRP 224.0.0.22-Used by IGMP IP Address Classes (IPv4) CLASS E The range of this class is from 240-255 and is not meant for general use. These are typically used for experiments. IPv4 Address Hierarchy IP addresses have a hierarchy that makes it easier to route data around the Internet. IPv4 address is hierarchical. It is Composed of a Network portion and Host portion. One part of the IP address is designated as the Network Address (or Network ID) and the other part as a Node Address (or Host ID), giving it a layered, hierarchical structure. IPv4 Address Hierarchy Network Address or Network ID The network address uniquely identifies each network. Every machine on the same network shares that network address as part of its IP address. IPv4 Address Hierarchy Node Address or Host ID The node address is assigned to, and uniquely identifies, each machine in a network. This part of the address must be unique because it identifies a particular machine—an individual, as opposed to a network. Node Address can also be referred to as a host address or host id. IPv4 Address Hierarchy Together as the IP address, the network address and the node address uniquely identify a device within an internetwork. IPv4 Address Hierarchy Address classes are defined, in part, based on the number of bits that make up the network portion of the address, and in turn, on how many are left for the definition of individual host addresses. In Class A addresses, the first octet is the network portion. The second, third, and fourth octets are the host portion: Example: 10.20.15.1 (Class A) Network ID (Network Address) = 10.0.0.0 Host ID (Node Address) = 0.20.15.1 IPv4 Address Hierarchy In Class B, the first and second octets are the network portion. The third and fourth octets are the host portion: Example: 130.57.30.56 (Class B) Network ID (Network Address) = 130.57.0.0 Host ID (Node Address) = 0.0.30.56 IPv4 Address Hierarchy In Class C, the first 3 octets are the network portion and the last octet is the host portion: Example: 192.168.15.3 (Class C) Network ID (Network Address) = 192.168.15.0 Host ID (Node Address) = 0.0.0.3 IPv4 Address Hierarchy IP Address Classes (IPv4) IPv4 Decimal Leading Default Subnet Mask Maximum Number Maximum Actual IP Range CLASSES Range of First Bits Mask Bits/ of Networks Number of Octet of Network (Assignable Host Bits Networks Class A 0-127 0 255.0.0.0 8 2(8 – 1) = 128 224 - 2 0.0.0.0 – 127.255.255.255 =16,777,214 Class B 128-191 10 255.255.0.0 16 2(16 – 2) =16,384 216 - 2 128.0.0.0 – 191.255.255.255 =65,534 Class C 192-223 110 255.255.255.0 24 2(24-3) 28 - 2 =254 192.0.0.0 – 223.255.255.255 =2,097,152 IP Address Classes (IPv4) Private IP Address The Internet Assigned Numbers Authority (IANA) has assigned several address ranges to be used by private network. An IP address within these ranges is therefore considered non-routable, as it is not unique. Any private network that needs to use IP addresses internally can use any address within these ranges without any coordination with IANA or an Internet registry. Addresses within this private address space are only unique within a given private network. All addresses outside these ranges are considered public. IPv4 CLASSES Private IP Range Class A 10.0.0.0 - 10.255.255.255 Class B 172.16.0.0 - 172.31.255.255 Class C 192.168.0.0 - 192.168.255.255 IP Address Classes (IPv4) Public IP Address All addresses outside private IP address ranges are considered public. But all the IP addresses that fall into one of the following predefined public IP address ranges are definitely public IP addresses. Public IP addresses are significantly more common than private IP addresses, and the public IP address ranges are: IPv4 CLASSES Public IP Range Class A 1.0.0.0 - 9.255.255.255 11.0.0.0 - 126.255.255.255 Class B 129.0.0.0 - 169.253.255.255 169.255.0.0 - 172.15.255.255 172.32.0.0 - 191.0.1.255 Class C 192.0.3.0 - 192.88.98.255 192.88.100.0 - 192.167.255.255 192.169.0.0 - 198.17.255.255 198.20.0.0 - 223.255.255.255 END OF LESSON 3 REFERENCES: https://geekflare.com/understanding-ip-address/ https://ipwithease.com/ip-addressing-scheme- ipv4/#:~:text=What%20is%20IP%20Addressing%20Scheme,help%20of%20a%20subnet% 20mask. https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol- rip/13788-3.html#toc-hId--1733132837 https://www.cisco.com/c/dam/global/en_ca/solutions/strategy/docs/sbaBN_IPv4addrG. pdf https://www.networkcomputing.com/networking/cisco-networking-basics-ip-addressing https://www.serverbrain.org/network-implementation-2003/the-hierarchical-ip- addressing-scheme.html https://www.khanacademy.org/computing/computers-and- internet/xcae6f4a7ff015e7d:the-internet/xcae6f4a7ff015e7d:addressing-the- internet/a/ip-address-hierarchy REFERENCES: https://avinetworks.com/glossary/subnet-mask/ https://www.spiceworks.com/tech/networking/articles/what-is- subnet-mask/ https://www.ciscopress.com/articles/article.asp?p=330807&seqNum =2