Advanced Computer Networks PDF
Document Details
Uploaded by Deleted User
Dr Adnan Haider
Tags
Summary
These lecture notes cover advanced computer networks, focusing on IPv4 addressing, subnetting, network address translation (NAT), and other related topics.
Full Transcript
Advanced Computer Networks DR ADNAN HAIDER IPv4 32 bits Classes vs Classless and subnetting Unicast Multicast Broadcast Network Address Translation (NAT) IP addressing Internet Protocol (IP) Two versions (IPv4, IPv6) IPv4 is 32 bit IP addressing is a softw...
Advanced Computer Networks DR ADNAN HAIDER IPv4 32 bits Classes vs Classless and subnetting Unicast Multicast Broadcast Network Address Translation (NAT) IP addressing Internet Protocol (IP) Two versions (IPv4, IPv6) IPv4 is 32 bit IP addressing is a software address that is used to locate a device in a network. Network addressing: networks are divided into subnetworks with different network addresses in order to break L2 broadcast domains into multiple smaller broadcast domains. It is used for routing packets IP addressing | IPv4 32 bits Example: 10101100000100000001111000111000 10101100 00010000 00011110 00111000 Simplified: 172.16.30.56 AC.10.1E.38 Some software store IP addresses as hexadecimal IP addressing | IPv4 IP address is divided mainly into Network and Host There are 5 classes of IP addressing but 3 are commonly used. IP addressing | IPv4 | Class Identification IP address is divided mainly into Network and Host There are 5 classes of IP addressing but 3 are commonly used. Network Host IP range per class Class A 0 0.0.0.0 – 127.255.255.255 Class B 10 128.0.0.0 – 191.255.255.255 Class C 110 192.0.0.0 – 223.255.255.255 Class D - Multicast 1110 224.0.0.0 – 239.255.255.255 Multicast addresses has no network parts because each address represent a group (multicast) IP addressing | Network Address IP address is divided mainly into Network and Host There are 5 classes of IP addressing but 3 are commonly used. Network address: make all host bits 0s Network Host Class A 0 00000000 00000000 00000000 Class B 10 00000000 00000000 Class C 110 00000000 Example: 10.0.0.0 is the network address in Class A IP addressing | Broadcast Address IP address is divided mainly into Network and Host There are 5 classes of IP addressing but 3 are commonly used. All nodes/hosts address: make all host bits 1s Network Host Class A 0 11111111 11111111 11111111 Class B 10 11111111 11111111 Class C 110 11111111 Example: 10.255.255.255 means all hosts in the network address 10.0.0.0 from Class A IP addressing | IPv4 | Reserved Addr Reserved Addresses Notes 0.X.X.X All networks 127.X.X.X Loopback addresses 255.255.255.255 Broadcast IP Address 169.254.X.X Link-local addresses How many networks in Class A, B, and C? IP addressing | Classless Addressing In classless addressing, network address is determined using network mask Therefore, dividing a network address into multiple smaller network addresses (subnetting) is possible Subnetting: a single big network is divided into multiple smaller subnetworks IP addressing | IPv4 | Net Mask Net Mask is composed of a series of 1s followed by 0s. Network prefix length (/n) is an abbreviation of net mask (e.g. 255.255.0.0 has network prefix length of /16) IP Address Net Mask 11111111 11111111 00000000 00000000 AND Network Address 00000000 00000000 Example: What is the network address of 172.168.20.33 if net mask is 255.255.0.0? Answer: 172.168.0.0 IP addressing | IPv4 | Broadcast Broadcast address (subnet broadcast address) is obtained by setting all host bits to 1s IP Address Net Mask Invert 11111111 11111111 OR Network Address 11111111 11111111 Example: What is the subnet broadcast address of 172.168.20.33 if net mask is 255.255.0.0? Answer: 172.168.255.255 CIDR Notation CIDR: Classless Inter-domain Routing Network prefix is of variable length IP address IP address: 192.168.20.33 Net mask: 255.255.255.0 ≡ 192.168.20.33/24 Network prefix length IP addressing | Subnetting IP addressing | Subnetting Method of Subnetting: FLSM: Fixed Length Subnet Mask A block of IP addresses is divided into multiple subnets of equal length It is calculated based on maximum number of hosts or sub-networks VLSM: Variable Length Subnet Mask A block of IP addresses is divided into multiple subnets of variable length for more efficiency in utilizing the full range of IP addresses IP addressing | Subnetting | VLSM Make a list of all possible subnets List the maximum number of hosts in descending order Refer to the table created in step 1 and start subnetting as per the information given in the second table. Example: If the administrator has IP 192.168.1.0/24 and want to make a subnet for each department with different number of hosts (Sales and Purchase: 120, Development: 50, Accounts: 26, Management: 5). Use VLSM to a efficiently make 4 subnets. Example Solution Slash Hosts Department Hosts [Given info] Notations Sales 120 Reordered in descending order 24 254 Development 50 25 126 Accounts 26 26 62 Management 5 Generated subnets using VLSM 27 30 Network Hosts Start Address Last Address 28 14 (network) (Broadcast) 29 6 192.168.1.0/25 126 192.168.1.0 192.168.1.127 30 2 192.168.1.128/26 62 192.168.1.128 192.168.1.191 192.168.1.192/27 30 192.168.1.192 192.168.1.223 192.168.1.224/29 6 192.168.1.224 192.168.1.231 Reference Table IP addressing | IPv4 | Reserved Addr Reserved Addresses Notes 0.X.X.X All networks 127.X.X.X Loopback addresses 255.255.255.255 Broadcast IP Address (this network – broadcast domain) 169.254.X.X Link-local addresses(Zeroconf) How many networks in Class A, B, and C? Exercise Who can contact who, and why? IPv4 You need IP address with netmask to be able to indicate the network you can communicate with and to communicate with IP addresses belongs to your network address In order to connect to other networks (IP addresses with different network address) you need to configure a gateway IP address. All packets destined to other networks will be sent to the gateway(destination MAC address only) through Layer 2. Gateway is a router. In order to communicate with other devices using name instead of IP address you need to configure DNS IP address on your machine. DNS server is responsible for resolving names into IP addresses. Private IPv4 Address Range IPv4 | Connecting To Internet You need a public IPv4 to connect to the internet You can get public IP address through a network address translation technique. IPv4 | NAT | Objectives Pooling of IP addresses Supporting migration between network service providers IP masquerading and internal firewall Load balancing of servers IPv4 | NAT Static Natting Dynamic Natting Port based NAT (Port Address Translation PAT, Network address and port translation NAPT, or NAT Overload) Single public IP to multiple devices Pooling of IP addresses Private Network Internet Source = 10.0.1.2 Source 128.143.71.21 = 10.0.1.2 Source = 128.143.71.21 Destination = 64.236.24.4 Destination = 64.236.24.4 Destination = 64.236.24.4 private address: 10.0.1.2 NAT public address: 128.143.71.21 Device Host Public Host Private Public Address Address 64.236.24.4 10.0.1.2 128.59.16.21 Pool of public IP addresses 128.59.16.16-128.59.16.30 Migration between ISPs Migration between ISPs IP Masquerading Source = 10.0.1.2 Source = 128.59.71.21 Source port = 2001 Source port = 2100 private address : 10.0.1.2 NAT device Host 2 Internet 10.0.0.1 128.16.71.21 private address : 10.0.1.3 Host 1 Source = 10.0.1.3 Source = 128.59.71.21 Source port = 3020 Destination = 4444 Private network Private Public Address Address 10.0.1.2/2001 128.143.71.21/2100 10.0.1.3/3020 128.143.71.21/4444 Load Balancing NAT | Advantages Conserves legally registered IP addresses Provides privacy Eliminates address renumbering when a network evolves (i.e. easy migration) NAT | Concerns Performance Performance degradation due to L3/L4 header manipulation which require checksum recalculation for both layers Fragmentation All fragments must have same IP and port addresses End-to-End Connectivity IP address in application data FTP | Active Mode FTP | Passive Mode CGN Carrier Grade NAT (CGN or CGNAT) or Large Scale NAT (LSN) RFC6598 details a shared address space for use in ISP CGN deployments that can handle the same network prefixes occurring both on inbound and outbound interfaces. RFC6598 allocated the address block 100.64.0.0/10 Pros: Solve the IPv4 address exhaustion problem for clients only but not web servers. Cons: The risk of banning multiple hosts at once. 2- Security issues (stateful connections). 3- End-to-end Connection. NAPT Behavior Classifications Full-cone NAT (one-to-one NAT) (iAddr:iPort) is mapped to (eAddr:ePort) ⟵ −−− ⟶ (AnyAddr:AnyPort) (Address) restricted-cone NAT (iAddr:iPort) is mapped to (eAddr:ePort) ⟵ −−− ⟶ (hAddr:AnyPort) Port restricted cone NAT (iAddr:iPort) is mapped to (eAddr:ePort) ⟵ −−− ⟶ (hAddr:hPort) Symmetric NAT (bi-directional NAT) different ePort for each different combination of (iAddr:iPort ⟵⟶ hAddr:hPort) NAT Mapping Behavior The test is done (with changes done for hAddr and hPort at client side to server) Endpoint-Independent Mapping NAT iAddr:iPort is mapped to eAddr:ePort for both hAddr1:hPort and hAddr2:hPort are equal Address-Dependent Mapping NAT (ADM-NAT) iAddr:iPort is mapped to eAddr:ePort for both hAddr:hPort1 and hAddr:hPort2 are equal if hAddr does not change Address and Port-Dependent Mapping NAT (APDM-NAT) iAddr:iPort is mapped to eAddr:ePort for any different hAddr or hPort NAT Filtering Behavior NAT Filtering Behavior Server change the source addresses (IP or/and port) of its response to examine the NAT Filtering Behavior Endpoint-Independent Filtering NAT (EIF-NAT) Address-Dependent Filtering NAT (ADF-NAT) Address and Port-Dependent Filtering NAT (APDF-NAT) Make Your Device Accessible Through NAT To Make your NATed device accessible from the internet you can apply one of the following Port Forwarding Static NATing Q&A