Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4-2 IP address.

Similar presentations


Presentation on theme: "Chapter 4-2 IP address."— Presentation transcript:

1 Chapter 4-2 IP address

2 Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing IP address 2

3 The Internet Network layer
Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP Transport layer: TCP, UDP IP protocol addressing conventions datagram format packet handling conventions Network layer forwarding table ICMP protocol error reporting router “signaling” Link layer physical layer Computer network-Link Layer and LANs IP address 3 3

4 Objectives Concept of IP Address Class of IP Address
Reserved and Private IP Address Network Mask and Subnetting VLSM and CIDR IP address

5 IP Address Each computer in a TCP/IP network must be given a unique identifier, or IP address. An IP address is a 32-bit sequence of 1s and 0s. IP address

6 Representation of IP Address
To make the IP address easier to use, the address is usually written as four decimal numbers separated by periods IP address

7 Structure of IP Address

8 IP地址的类别(Class of IP Address)

9 Class A Address Range:1-126(127 Reserved) IP address

10 Class B Address Range: IP address

11 Class C Address Range: IP address

12 Address Allocating Allocate A class IP:(国际网络信息中心NIC)
Allocate B class IP :InterNIC、APNIC、ENIC Allocate C class IP (国家或地区的NIC) IP address

13 Reserved Address Certain host addresses are reserved and cannot be assigned to devices on a network. An IP address that has binary 0s in all host bit positions is reserved for the network address. An IP address that has binary 1s in all host bit positions is reserved for the broadcast address. An IP address that has binary 0s in all bit positions is reserved for default route An IP address that has binary 1s in all bit positions is reserved for flood broadcast IP address

14 Private IP Address Private IP addresses are another solution to the problem of the impending exhaustion of public IP addresses. Private IP addresses are not routed on the Internet backbone. IP address

15 Exercise: IP Address Classes
Network Host IP address

16 IP Address Classes Exercise Answers
Network Host A B C Layer 2 of 2: Purpose: This answers to the exercise are given in the figure. Note: Students can also find the answers to this exercise in the “Answers” appendix. C B Nonexistent IP address

17 Network Mask Class A:255.0.0.0 classB:255.255.0.0
class C: IP address

18 Function of Network Mask
Network ID IP address

19 Subnetting To efficiently manage a limited supply of IP addresses, all classes can be subdivided into smaller subnetworks. IP address

20 Reasons for Subnetting
Provides addressing flexibility Provides Broadcast Containment Low-level security on the LAN IP address

21 Introduction to Subnetting
Host bits must are reassigned (or “borrowed”) as network bits. 3 bits borrowed allows 23-2 or 6 subnets 5 bits borrowed allows 25-2 or 30 subnets IP address 12 bits borrowed allows or 4094 subnets

22 Introduction to Subnetting
不考虑子网 Net id Host id Net mask Net id Host id 考虑子网化 Net mask Net id Subnet id Host id Extended net id IP address

23 Comparison between decimal and binary
IP address

24 E.g1 Two Bits Subnetting for Class C
Subnet range ~ ~62 ~ ~127 ~ ~191 ~ ~255 IP address

25 Number of Usable Subnets and Hosts
(2 power of borrowed bits)–2 usable hosts= (2 power of remaining host bits)–2 IP address

26 Summary of Class C Subnetting
IP address

27 Written Exercise: Subnet Masks
Address Subnet Mask Class Subnet IP address

28 Subnet Mask Exercise Answers
Address Subnet Mask Class Subnet B A Layer 2 of 2: Purpose: This answers to the exercise are given in the figure. Note: Students can also find the answers to this exercise in the “Answers” appendix. A IP address

29 Broadcast Addresses Address Subnet Mask Class Subnet Broadcast
IP address

30 Broadcast Addresses Exercise Answers
Subnet Mask Class Subnet Broadcast C A B Layer 2 of 2: Purpose: This answers to the exercise are given in the figure. Note: Students can also find the answers to this exercise in the “Answers” appendix. B IP address

31 Subnets IP address: What’s a subnet ? subnet part (high order bits)
host part (low order bits) What’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router subnet network consisting of 3 subnets IP address 31

32 Subnets /24 /24 /24 Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. Subnet mask: /24 IP address 32

33 Subnets How many? IP address 33

34 IP addressing: CIDR CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part host /23 IP address 34

35 Subnet Programming 30 hosts per subnet Class C address: 201.222.5.0
Other subnets 30 hosts per subnet Class C address: IP address

36 Variable-Length Subnet Mask
HQ /16 IP address

37 Variable-Length Subnet Mask
/24 HQ HQ /16 /24 IP address

38 Variable-Length Subnet Mask
/27 A /24 /27 B HQ HQ /16 /24 /27 C Subnet /24 is divided into smaller subnets: Subnet with one mask at first (/27) IP address

39 Variable-Length Subnet Mask
/27 /30 A /24 /27 /30 B HQ HQ /16 /27 /24 C /30 Subnet with one mask at first (/27) Further subnet one of these subnets not used elsewhere (/30) IP address

40 Calculating VLSMs Subnetted Address: /20 In Binary IP address

41 Calculating VLSMs Subnetted Address: /20 In Binary VLSM Address: /26 In Binary IP address

42 Calculating VLSMs Subnetted Address: /20 In Binary VLSM Address: /26 In Binary 1st subnet: 1 1 1 1 . 1 . 1 . = /26 Network Subnet VLSM subnet Host IP address

43 Calculating VLSMs Subnetted Address: /20 In Binary VLSM Address: /26 In Binary 1st subnet: 1 1 1 1 . 1 . 1 . = /26 2nd subnet: 1 7 2 . 16 . 1 . 1 = /26 3rd subnet: 1 7 2 . 16 . 1 . 1 = /26 4th subnet: 1 7 2 . 16 . 1 . 1 1 = /26 5th subnet: 1 7 2 . 16 . 1 1 . = /26 Network Subnet VLSM Subnet Host IP address

44 Exercise:Design Network Using VLSM
Derived from the /20 Subnet (62 Hosts) (62 Hosts) (62 Hosts) (62 Hosts) IP address

45 Exercise Answer Derived from the 172.16.32.0/20 Subnet 172.16.32.0/26
/30 /26 /30 /30 /26 /30 /26 Derived from the /26 Subnet 30-Bit Mask (2 Hosts) 26-Bit Mask (62 Hosts) IP address

46 Again IP address

47 Net-id and host-id A class host-id 8 bit B class 16 bit C class 1
A class B class C class 1 D class Multicast address E class reserved IP address 47

48 range Class network No.s from to hostnumber
IP address 48

49 Five classes IP address
1/2 1/4 1/8 1/16 1/32 6 IP address IP地址与网络层 49

50 Some special IP address
50

51 Available? Which class? IP address 51

52 参考:Internet的IP地址和AS号码管理结构
ARIN RIPE NCC APNIC (Possible future RIRs) ICANN ASO (The Address Supporting Organization) NIR LIP ISP EU CNNIC End Users Internet Service Providers Local Internet Registries National Internet Registries CERnetNIC USTCNIC IP address 52

53 More about IP addressing
DHCP CIDR/VLSM NAT IP address

54 IP addresses: how to get one?
Q: How does a host get IP address? hard-coded by system admin in a file Windows: control-panel->network->configuration->tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play” IP address 54

55 DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on”) Support for mobile users who want to join network (more shortly) DHCP overview: host broadcasts “DHCP discover” msg DHCP server responds with “DHCP offer” msg host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg IP address Network Layer 55

56 DHCP client-server scenario
server B arriving DHCP client needs address in this network E IP address 56

57 DHCP client-server scenario
DHCP server: arriving client DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs IP address 57

58 IP addresses: how to get one?
Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23 IP address 58

59 Hierarchical addressing: route aggregation
Hierarchical addressing allows efficient advertisement of routing information: Organization 0 /23 Organization 1 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16” ISPs-R-Us IP address 59

60 Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organization 1 Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISPs-R-Us Organization 1 /23 IP address 60

61 NAT: Network Address Translation
rest of Internet local network (e.g., home network) 10.0.0/24 All datagrams leaving local network have same single source NAT IP address: , different source port numbers Datagrams with source or destination in this network have /24 address for source, destination (as usual) IP address 61

62 NAT: Network Address Translation
Motivation: local network uses just one IP address as far as outside world is concerned: range of addresses not needed from ISP: just one IP address for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus). IP address 62

63 NAT: Network Address Translation
Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table IP address 63

64 NAT: Network Address Translation
NAT translation table WAN side addr LAN side addr 1: host sends datagram to , 80 2: NAT router changes datagram source addr from , 3345 to , 5001, updates table , , 3345 …… …… S: , 3345 D: , 80 1 S: , 80 D: , 3345 4 S: , 5001 D: , 80 2 S: , 80 D: , 5001 3 4: NAT router changes datagram dest addr from , 5001 to , 3345 3: Reply arrives dest. address: , 5001 IP address 64

65 NAT: Network Address Translation
16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications address shortage should instead be solved by IPv6 IP address 65

66 NAT traversal problem client wants to connect to server with address server address local to LAN (client can’t use it as destination addr) only one externally visible NATted address: solution 1: statically configure NAT to forward incoming connection requests at given port to server e.g., ( , port 2500) always forwarded to port 25000 Client ? NAT router IP address 66

67 NAT traversal problem solution 2: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATted host to: learn public IP address ( ) add/remove port mappings (with lease times) i.e., automate static NAT port map configuration IGD NAT router IP address 67

68 NAT traversal problem solution 3: relaying (used in Skype)
NATed client establishes connection to relay External client connects to relay relay bridges packets between to connections 2. connection to relay initiated by client NAT router 1. connection to relay initiated by NATted host 3. relaying established Client IP address 68

69 next 4. 1 Introduction 4.2 Virtual circuit and datagram networks
4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing IP address 69


Download ppt "Chapter 4-2 IP address."

Similar presentations


Ads by Google