no slide titlebill/cnds2003_2004/cnds_unit06... · 2003-11-05 · data packet addresses converting...
TRANSCRIPT
Author: W.Buchanan. IP – The Address (2)
TTL=255
TTL=200
TTL=190TTL=170
TTL=50
TTL=25
TTL=12
TTL stops thedata packet from transversingthe Internet forever.
TTL=255
TTL=200
TTL=190TTL=170
TTL=50
TTL=25
TTL=12
TTL stops thedata packet from transversingthe Internet forever.
IP
Author: W.Buchanan. IP – The Address (3)
Mobile Networks (Unit 10)
Switches/VLANs (Unit 5)
IP Addressing/Subnets (Unit 6) TCP/Socket Programming (Unit 7)
Router Programming (Unit 8) Routing Protocols (Unit 9)
Introduction (Unit 1)
Net Elements (Unit 2) Net Types (Unit 3) Net Design (Unit 4)
Author: W.Buchanan. IP – The Address (4)
Application program
makes contact with network
application for e-mail
Application program
makes contact with network
application for e-mail
Application
Convert data into a form
which can be transmitted
Convert data into a form
which can be transmitted
Presentation
Contact remote system and request a transmission
Contact remote system and request a transmission
Session
Negotiate data transfer and
split data into segments
Negotiate data transfer and
split data into segments
Add source and
destination addresses
Transport
Add source and
destination addressesData packet
converting into a form which can be transmitted
over the network
Network
Data packet converting into a form which can be transmitted
over the network
Data link
The data frame is converted into
binary form and transmitted over a
physical connection
The data frame is converted into
binary form and transmitted over a
physical connection
Physical
E-mail application program
E-mail application program
Hello.Fred.
To: FredFrom: BertHello.Fred.
HELO sys.comFOR FredTo: FredFrom: BertHello.Fred.
Seg 1Seg 2Seg 3
Seg 1Addr
Seg 2Addr
Seg 3Addr
Seg 1AddrStart End
Data encapsulation
Seg 2AddrStart EndSeg 3AddrStart End
Author: W.Buchanan. IP – The Address (5)
Network address
Edinburgh Castle,10 Princes Street,EdinburghEH1 1LZ
Physicaladdress
OS Grid Co-ordinate:03434, 75321
CityStreetPlace
Author: W.Buchanan. IP – The Address (6)
Name:MyBookChapter: 1
Name:MyBookChapter: 2
Name:MyBookChapter: n
Address: 1 High St
Address: 1 High St
Address: 1 High St
I’m sending it,now.
I’m sending it,now.
What’s the maximumsize of the documentsthat can besent?Document is
split into chapters
Analogy
Sess
ion
Tran
spor
tN
etw
ork
Author: W.Buchanan. IP – The Address (7)
SortingOffice
SortingOffice
SortingOffice
SortingOfficeSorting
OfficeSortingOffice
Network (Logical address)
Network
Data link
Physical
Throughout the networkaddress stays the same,but the physical addresschanges
Actual (Physical address)
Author: W.Buchanan. IP – The Address (8)
Postal NetworkPostal Network SortingOffice
SortingOffice
SortingOffice
SortingOffice
The actual physical address is finallyresolved
Only at the end does the physical address and the logical address have to be resolved.
Author: W.Buchanan. IP – The Address (9)
Name:MyBookChapter: 3
Name:MyBookChapter: 5
Name:MyBookChapter: 1
Address: 1 High St
Address: 1 High St
Address: 1 High St
Document is reassembled
Analogy
Thanks. I’ve received it.
Thanks. I’ve received it.Se
ssio
nTr
ansp
ort
Net
wor
k
Author: W.Buchanan. IP – The Address (10)
InternetInternet
Only at the end does the physical address and the logical address have to be resolved.
Data segments (TCP)
Data packets (IP)
1 2
Ethernet
Analogy
The actual physical address is finallyresolved
Author: W.Buchanan. IP – The Address (11)
IP and MAC Addresses
IP Src: IP1IP Dest: IP8MAC Src: MAC1MAC Dest: MAC2
MAC2, IP2
MAC5, IP5MAC6, IP6
MAC8, IP8
MAC1,IP1
MAC3, IP3
MAC4, IP4 MAC7, IP7
IP Src: IP1IP Dest: IP8MAC Src: MAC3MAC Dest: MAC4
IP Src: IP1IP Dest: IP8MAC Src: MAC5MAC Dest: MAC6
IP Src: IP1IP Dest: IP8MAC Src: MAC7MAC Dest: MAC8
The IP addresses stay thesame but the MAC addresschanges
Author: W.Buchanan. IP – The Address (12)
IP and MAC Addresses
MAC2, IP2
MAC5, IP5MAC6, IP6
MAC8, IP8
MAC1,IP1
[Gateway is the port of the router]
MAC3, IP3
MAC4, IP4 MAC7, IP7
ARP broadcasts
Each network segmentdetermines MAC addressesof gateways by sendingand ARP broadcast.
Author: W.Buchanan. IP – The Address (13)
IP and TCP
NetworkNetwork
Data LinkData Link
PhysicalPhysical A router routes with the network address (such as the IP address)
IP address is used toroute data around the Internet
TCP part allows applications to communicate over the network
Author: W.Buchanan. IP – The Address (14)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
32
32
16
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal length
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
Source IP address
Routersroute withthe destinationaddress
Destination IP address
Author: W.Buchanan. IP – The Address (15)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet (IPv4)
The firstthing that isread is theversion.
IPv4 usesa 32-bit address.
IPv6 usesa 32-bit address.
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal length
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Author: W.Buchanan. IP – The Address (16)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet
A datagram could propagate through the internet indefinitely. To prevent this, the 8-bit time-to-live value is set to the maximum transit time in seconds and is set initially by the source IP. Each gateway then decrements this value by a defined amount. When it becomes zero the datagram is discarded. It also defines the maximum amount of time that a destination IP node should wait for the next datagram fragment.
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal length
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Author: W.Buchanan. IP – The Address (17)
Time-to-live field
TTL=255
TTL=200
TTL=190TTL=170
TTL=50
TTL=25
TTL=12
TTL stops thedata packet from transversingthe Internet forever.
Author: W.Buchanan. IP – The Address (18)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal length
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
Protocol (8 bits). Different transport protocols can be used on the datagram. The 8-bit protocol field defines the type to be used. E.g. 1 – ICMP and 6 – TCP.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Author: W.Buchanan. IP – The Address (19)
IP can support many different upper-layer protocols
InternetInternet
Voice overIP
TCPUDP
NetBIOSover IP
ICMP(ping,tracert)
IPX/SPXover IP
The Internet can supportmany different higher-layer protocols, not just TCP
Author: W.Buchanan. IP – The Address (20)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet (IPv4)
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal lengthVery basicChecksum.
Thus, thereIs very littleerror checking/verification.
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Author: W.Buchanan. IP – The Address (21)
IP header
IPIP TCPTCP Higher-level protocol/dataHigher-level protocol/data Data Packet
VersionVersion Header lengthHeader length Type of serviceType of service
Total lengthTotal length
IdentificationIdentification
00 DD MM Fragment OffsetFragment Offset
Time-to-LiveTime-to-Live ProtocolProtocol
Header ChecksumHeader Checksum
Source IP AddressSource IP Address
Destination IP AddressDestination IP Address
IPv4 addressIs 32 bits long.
- which onlyGives up to4 billion addresses (232)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Author: W.Buchanan. IP – The Address (22)
32 bits
Network Host
1010101010101010 0101010101010101 0011001100110011 1100110011001100
8 bits
170170 8585 5151 204204Dottednotation(W.X.Y.Z)
Binarynotation
NET(0–127)NET(0–127) HOSTHOST HOSTHOST HOSTHOST
NET (128 – 191)NET (128 – 191) NETNET HOSTHOST HOSTHOST
NET (192 – 223)NET (192 – 223) NETNET NETNET HOSTHOST
Class A
Class B
Class C
IP address classifications
Author: W.Buchanan. IP – The Address (23)
TCP/IP Intranet
PLUTO
OBERONDIONE
VENUS
Network B
MOON
JUPITERMERCURY
MARS
Network A
VAX01VAX02
ETHER C
RouterResponsible for examining IP address to determine if the TCP/IP packet must be routed out of the network, and the main network. Router must have two IP addresses as it is part of two network segments
RouterResponsible for examining IP address to determine if the TCP/IP packet must be routed out of the network, and the main network. Router must have two IP addresses as it is part of two network segments
Author: W.Buchanan. IP – The Address (24)
IP Address Types
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
00
11 00
11 11 00
Network (7 bits) Node (24 bits)
Network (14 bits) Node (16 bits)
Network (21 bits) Node (8 bits)
Class A
Class B
Class C
Author: W.Buchanan. IP – The Address (25)
TCP/IP Intranet
Network A[Network Number]
Network A[Network Number]
Network C[Network Number]
Network C[Network Number]
Network B[Network Number]
Network B[Network Number]
Network NumberNetwork Number Host NumberHost Number
IP address
w.x
w.x.y.z
GlobalnetworkGlobalnetwork
[Host Number]
Author: W.Buchanan. IP – The Address (26)
TCP/IP Intranet with Subnets
Network A[Network Number]
Network A[Network Number] Network B
[Network Number]
Network B[Network Number]
Network NumberNetwork Number
IP address (Type B) PC419: 146.176.151.130
[Host Number]
Lab Block: 146.176.151Subnet A
[Subnet Number]
Subnet A[Subnet Number]
Subnet B[SubnetNumber]
Subnet B[SubnetNumber]
Subnet Number
Subnet Number
Host NumberHost
Number
Computing mainblock: 146.176.160
Napier: 146.176
Subnet A[Subnet Number]
Subnet A[Subnet Number]
Subnet A[Subnet Number]
Subnet A[Subnet Number]
W.X
W.X.Y
W.X.Y.Z
Typical Subnet masksClass A: 255.0.0.0Class B: 255.255.0.0Class C: 255.255.255.0
Typical Subnet masksClass A: 255.0.0.0Class B: 255.255.0.0Class C: 255.255.255.0
GlobalnetworkGlobalnetwork
Author: W.Buchanan. IP – The Address (27)
Class A IP Address
Network 1Network 2
Network 3Network
NetworkNetwork
Class ANetwork: 1 - 126Host: 0.0.1 - 255.255.254
Few networks, and many hosts
1 16,711,680
Net. 127
Networks: Few
Networks: Many
InternetInternet
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
Author: W.Buchanan. IP – The Address (28)
Class B IP Address
Network 1Network 2
Network 3Network
NetworkNetwork
Net. 16,320
Class BNetwork: 128.1 - 191.254Host: 0.1 - 255.254
Large number of networks, large number of host (althoughnot as many as Class A)
1 65,024
Networks: Average
Networks: Average
InternetInternet
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
Author: W.Buchanan. IP – The Address (29)
Class C IP Address
Network 1Network 2
Network 3Network
NetworkNetwork
Net. 2,088,960
Class CNetwork: 192.0.1 - 223.255.254Host: 1 - 254
Large number of networks, and few hosts
1 255
Networks: Many
Networks: Few
InternetInternet
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
IP Address RangesNetwork Host
Class A: 1-126 0.0.1 to 255.255.254(127 networks) (16,711,680 hosts)
Class B: 128.1 to 191.254 0.1 to 255.254(16,320 networks) (65,024 hosts)
Class C: 192.0.1 to 223.255.254 1 to 254(2,088,960 networks) (255 hosts)
Author: W.Buchanan. IP – The Address (30)
Network addresses, and broadcasting
32.0.0.0 (Class A network address).146.176.0.0 (Class B network address).199.20.30.0 (Class C network address).
32.255.255.255 (Class A broadcast into 32.0.0.0).146.176.255.255 (Class A broadcast into 146.176.0.0).199.20.30.255 (Class C broadcast into 199.20.30.0).
Network Addresses – The address used to represent the whole of a network
NetW.Z.0.0 Broadcast Addresses – All nodes on the
addressed network will listen to the transmission
NetW.Z.0.0
NetW.Z.Y.0
NetW.Z.Y.0
NetW.0.0.0
NetW.0.0.0
NetW.Z.0.0
NetW.Z.0.0
Author: W.Buchanan. IP – The Address (31)
Subnetting masks for Class B addresses
Subnet address Dotted not. Max sub. Max hosts (/subnet)11111111.11111111.11000000.00000000 255.255.192.0 2 16382 11111111.11111111.11100000.00000000 255.255.224.0 6 819011111111.11111111.11110000.00000000 255.255.240.0 14 409411111111.11111111.11111000.00000000 255.255.248.0 30 204611111111.11111111.11111100.00000000 255.255.252.0 62 102211111111.11111111.11111110.00000000 255.255.254.0 126 51011111111.11111111.11111111.00000000 255.255.255.0 254 25411111111.11111111.11111111.10000000 255.255.255.128 510 12611111111.11111111.11111111.11000000 255.255.255.192 1022 6211111111.11111111.11111111.11100000 255.255.255.224 2046 3011111111.11111111.11111111.11110000 255.255.255.240 4094 1411111111.11111111.11111111.11111000 255.255.255.248 8190 611111111.11111111.11111111.11111100 255.255.255.252 16382 2
For example, if the network address is 144.32.0.0 andthe five bits are used for the subnet mask then:
The network 144.32.{00001} 000.0000 0000 is the first subnet – 144.32.8.0(node range 144.32.8.1 to 144.32.15.254)and 144.32.{11110} 000.0000 0000 is the last subnet – 144.32.240.0(node range 144.32.240.1 to 144.32.255.254)
Author: W.Buchanan. IP – The Address (32)
Example Domain Naming Structure
salessalesresreswwwwww
necnecsonysonyintelintel
pc01pc01wwwwwwsun01sun01
mmsemmsedcsdcseeceeece
hwhwnapiernapiereded
orgorgacaccoco
www.sony.com
pc01pc01
pc01.eece.napier.ac.uk
frfrukukdedemilmilgovgovcomcomeduedu Primary domain
Example DNS mappingsDomain name IP addressweb.nec.com 143.101.15.6www.sony.com 198.83.178.11www.intel.com 134.134.214.1www.ieee.com 140.98.1.1
Example DNS mappingsDomain name IP addressweb.nec.com 143.101.15.6www.sony.com 198.83.178.11www.intel.com 134.134.214.1www.ieee.com 140.98.1.1
Author: W.Buchanan. IP – The Address (33)
Domain name server
InternetInternetInternetInternet
Once WWW browser has theIP address of the destination,it can then access it
DNS returns back theIP address of thedomain name
WWW browser asksThe DNS for the IPaddress of the domainname
Domain nameserver
DNS may interrogateOther DNS’s toDetermine IP addresses
Author: W.Buchanan. IP – The Address (34)
Allocating IP addresses
• Limiting access to the Internet. IP addresses can be mapped to MAC addresses. A node which requires an IP address will ask the IP granting server for an IP address. The server then checks the host’s MAC address to determine if it is allowed to access the Internet. If it is not, the server does not return an IP address. The system administrator can thus set up a table which only includes the hosts which are required to connect to the Internet.
• Authenticating nodes. A typical hacking method is to steal an IP address and use it for the time of a connection. This can be overcome by making all of the nodes on the network ask the IP granting server for their IP address. It is thus not possible to steal an address, as the IP granting server will check the MAC address of the host.
• Allocating from a pool of IP addresses. An organization may be granted a limited range of IP addresses which is not enough to allocate to all the nodes in the organization. The IP granting server can thus be set up to allocate IP addresses to nodes as they require them. When all the IP addresses have been allocated, no more IP addresses can be given out. When a node is finished with its IP address, the IP address that was granted to it can be put back in the pool when it is finished with it.
• Centralized configuration of IP addresses. The system manager can easily setup IP addresses to nodes from the central IP granting server.
• Barring computers from connecting to a network. Some networks are set up so that they must get a valid IP address before they can connect to the network (typically in Unix-type networks). The IP granting server will check the MAC address of the requester, if it is not allowed the server will not grant it an IP address.
Author: W.Buchanan. IP – The Address (35)
University Network
ComputerStudiesRouter
146.176.160.1
ComputerStudiesRouter
146.176.160.1
MechanicalDepartment
Router146.176.129.1
MechanicalDepartment
Router146.176.129.1
ElectricalDepartment
Router146.176.151.254
ElectricalDepartment
Router146.176.151.254
146.176.160
Gateway146.176.1.3
Gateway146.176.1.3
InternetInternet
146.176.144146.176.145146.176.146146.176.150146.176.151
Author: W.Buchanan. IP – The Address (36)
Example network
146.176.144
pc2 pc3
Dione
SaturnMercury
Earth
Pluto
Venus
Titan
Io
Phobos
Neptune
Ariel
Rhea
+Demos+Uranus
Oberon
Moon
Mimas
HP
VAX
Miranda
Triton
Vega(X)
Rigel(X)
Mwave
Intel
Leda
Castor
Pollux
Spica
Token Ring networks
PC Ethernetnetwork
146.176.151
146.176.150
146.176.146
146.176.145 146.176.147
eepc02eepc01
WorkstationEthernet network
Author: W.Buchanan. IP – The Address (37)
MAC1,IP1
[IP address][Subnet mask][Gateway is the port of the router]
[IP address][Subnet mask]
[IP address][Subnet mask]
Author: W.Buchanan. IP – The Address (39)
IPCONFIG /ALL
Ethernet adapter Local Area Connection 3:
Connection-specific DNS Suffix . : myuni.ac.ukDescription . . . . . . . . . . . : Realtek RTL8139/810x Family Physical Address. . . . . . . . . : 00-0A-E4-01-2C-F1Dhcp Enabled. . . . . . . . . . . : YesAutoconfiguration Enabled . . . . : YesIP Address. . . . . . . . . . . . : 192.168.0.13Subnet Mask . . . . . . . . . . . : 255.255.255.0Default Gateway . . . . . . . . . : 192.168.0.254DHCP Server . . . . . . . . . . . : 146.176.2.205DNS Servers . . . . . . . . . . . : 146.176.1.5
212.4.208.100Primary WINS Server . . . . . . . : 146.176.2.205Secondary WINS Server . . . . . . : 146.176.2.204Lease Obtained. . . . . . . . . . : 05 November 2003 09:19:35Lease Expires . . . . . . . . . . : 08 November 2003 09:19:35
Author: W.Buchanan. IP – The Address (40)
DHCPserver
Here’s my MAC address.What’s my IP address?
Here it is…
DNSserver
What’s the IP address forthis site?
Here it is…
WINSserver
Here’s my Windows name.Can I have an IP address?
Here it is…
Author: W.Buchanan. IP – The Address (41)
Network address translation
NATRouterNAT
Router
IP Src: 192.168.10.12
IP Dest: 11.22.33.44
IP Src: 192.168.10.12
IP Dest: 11.22.33.44
Outgoing dataOutgoing data
IP Src: 168.10.34.21
IP Dest: 11.22.33.44
IP Src: 168.10.34.21
IP Dest: 11.22.33.44
Outgoing dataOutgoing data
IP Src: 11.22.33.44
IP Dest: 168.10.34.21
IP Src: 11.22.33.44
IP Dest: 168.10.34.21
Incoming dataIncoming data
IP Src: 11.22.33.44
IP Dest: 192.168.10.12
IP Src: 11.22.33.44
IP Dest: 192.168.10.12
Incoming dataIncoming data
PAT (Port address translation) – Maps many addresses to one global address.
Author: W.Buchanan. IP – The Address (42)
NAT – The advantages
• Increases range of address.• Hides the network address of the network.• Allow easy creation of subnetworks.
Network can use their own network addresses, such as10.10.0.1, 10.10.0.2,and so on.
Network can use their own network addresses, such as10.10.0.1, 10.10.0.2,and so on. NATNAT
Globaladdresses(which areunique on theInternet)