Transmission Control Protocol / Internet Protocol

Download Report

Transcript Transmission Control Protocol / Internet Protocol

Transmission Control Protocol /
Internet Protocol and Network
Utilities
Colin Jamison
University of Ulster
Network Protocols
Protocol - used by computers to exchange
information over a network
The most common is TCP/IP originated by
the U.S department of Defence
If IP is the native language of the Internet
then
TCP represents one of many specialised
dialects
Sockets
De facto portable standard for portable
applications on TCP/IP
Sockets available on most PC OSs and
Mainframes
Internet Address(IP) and Port Address
netid . hostid . portid
Allocation of IP addresses
Network Information Centre (NIC)
NIC handles the administration of IP address
allocation to an organisation
5-types of IPv4 IP addresses can be allocated
Class A, Class B, Class C, Class D, Class E
These allow the internet address to be broken
into blocks of small, medium and large networks
IP Address Format
Represented by a string of 4-bytes separated by full-stops
Each byte contains 8 bits - so each byte ranges from 0 to
255 decimal
or 0000 0000 to 1111 1111 binary
From
000.000.000.000
To
255.255.255.255
Breakdown of the IP Address
The IP address consists of 2 parts which
are, a netid and a hostid
Start-Bits
Netid
Hostid
Total
Class A
1
+
7
+
24
=
32
Class B
2
+
14
+
16
=
32
Class C
3
+
21
+
8
=
32
IP Address Classes
Class A for extremely large networks
(up 16 million hosts) - no longer issued
Class B for medium sized networks
(65534 hosts)
Class C for small networks (254 hosts)
Class D reserved for multicast
Class E reserved
Breakdown of IP Address Classes
Class
Class
Class
Class
Class
A
B
C
D
E
1.0.0.0 - 126.0.0.0
129.0.0.0 - 191.255.0.0
192.0.0.0 - 223.255.255.0
224.0.0.0 - 239.255.255.0
240.0.0.0 - 255.255.255.0
Host Addresses (1)
Each computer network interface is
identified by a unique IP address
If a computer has more than one
interface then it uses multiple IP
addresses - one for each interface
Host Addresses (2)
Each packet has a destination address
All hosts on the network examine each
broadcast packet
If addressed to them then the host
processes it - otherwise it is ignored
Limit to the Number of Hosts
2 IP addresses are reserved in each type
of class,and these are 0
e.g. 194.23.12.0 which is the address of
the network itself
and
255 which is the broadcast address
e.g. 194.23.12.255
Subnets
Each host must determine if a broadcast
packet is for it
For a large number of hosts each host
must process many packets
To maintain efficiency in a network the
network is split into sub-networks
(subnets)
The network is divided by sub-netting to
create self-contained broadcast domains
Subnet Masks
A subnet mask is a bit mask that allows
you to determine which parts of an IP
address correspond to the :1) network address, and
2) subnet
When you AND an IP address and a
subnet mask the result is an address that
contains everything but the hostid
Resolving IP Addresses
Decimal
Binary
Class B Class B netid hostid
IP Address
131 .204
.27
.27
Subnet Mask
255
.255
.255
.0
Class B
Class B
netid
hostid
1000 1100 . 1100 1100 . 0001 1011 . 0001 1011
1111 1111 . 1111 1111 . 1111 1111 . 0000 0000
1000 1100 . 1100 1100 . 0001 1011 . 0000 0000
Subnet Number
131
.204
.27
.0
Network Utilities
netstat
route
arp
ifconfig
ping
traceroute
netstat
Netstat prints information about the Linux
networking subsystem
The type of information printed is
controlled by the option given
-a displays both listening and nonlistening sockets
-r displays the routing table
/bin/netstat
route
Used to add or delete to the kernels IP
routing table.
Its primary use is to setup static routes to
specific hosts or networks
Without options it displays the current
contents of the routing table
/sbin/route
arp
Manipulates the kernels address
resolution protocol (ARP) cache in various
ways
The main use is to setup and clear an
address mapping entry
/sbin/arp -a
ifconfig
ifconfig is used to configure the kernels resident
network interfaces
it is used at boot time to set up the computers
interfaces
If no arguments are specified it displays the
status of the given interface only
If -a is specified it displays the status of all
interfaces
/sbin/ifconfig
ping
Used to send packets to a destination
hostname or IP address and display the
response from the destination
Useful to detect intermittent or nonexistent network connectivity
ping destination
traceroute
Traces the path of packets through the
local network or Internet to the specified
destination
The destination can either be a hostname
or IP address
Useful as a network debugging aid
/usr/sbin/traceroute destination
Questions?