protocol port

Download Report

Transcript protocol port

DETAILS OF PROTOCOLS
The Zoo Protocol
-TCP
-IP
[email protected]
1
A programmer can create Internet
application software without
understanding the underlying network
technology or communication
protocols
- we will take a different approach
Understanding the Zoo Protocol
2
Transmission Control
Protocol (TCP)
3

Protocol at transport layer


Sending message from client process to server
process
How client process could access services
from server process?

Inter-process communication is carried out
through protocol port
4
Protocol Port



Port number is assigned to process by
operating system
There are 216 ports (0 to 65535)
There are 2 sets of port


for UDP protocol
for TCP protocol
5








Port well-known (1 – 1023)
For standardized
HTTP [80], SMTP[25], FTP[21, 22], POP3[110], Telnet
[23]
Ephemeral port (1024 – 65535)
Assigned dynamically
Assigned to client process
When client process complete, port will be released
The complete assigned list of ports can be seen with
instruction /etc/services (at *nix)
6
Host sun1.ftsm.ukm.my
/etc/services
7
Transmission Control
Protocol (TCP)



Provide reliable sending services
Use protocol port for addressing process
For application that needed trust such as:
telnet, http, ftp etc.
8
Header Format of TCP
9
TCP connection




TCP connection is identified with the last
point (port number) of the connection
To establish the connection, TCP needs
both ways cooperation
Client will request a port from server
Server will open the port to start the
connection
10
Three-Way Handshaking


TCP uses three-way handshaking while
starting and ending connection to provide
reliability
Determine that both nodes are ready as
well as to put the sequence number in
order to synchronize the connection
11
Starting TCP connection




Use SYN segment to create a connection
Host 1 sends SYN segment and random
sequence number
Host 2 reply to SYN segment, by sending ACK
to Host 1 and random sequence number
Host 1 reply with ACK
12
13
Ending TCP connection


TCP uses FIN
segment for ending
the connection
Four-way handshaking
14
User Datagram Protocol (UDP)






It is a transport protocol
Provide communication without unreliable
communication
Packet may be lost or it is not following the
sequence
No intermediary– receive data from application
and immediately send it
Used when no error control needed.
For process such as : DNS [53], echo [7], tftp [69],
SNMP[161]
15
UDP Datagram Format

Header





Source UDP Port (16 bit)
Destination UDP Port (16 bit)
UDP message length (16 bit)
UDP Checksum (16 bit)
Data
Source UDP Port
Destination UDP Port
UDP message lenght
UDP Checksum
Data
16
Internet Protocol (IP)
17
IP





Protocol at network layer
Provide packet sending via communication
without connection
Use IP for addressing
Determine packet flow through one and more leap
(hop) throughout the flow
Provide mechanism that includes



Data unit which called IP datagram
Software to send datagram
Method how host computer process datagram
18
Figure 19.2
Links in an internetwork
19


IP responsible in providing best-effort sending for
packet/datagram
How about the communication in the Internet ?



Transport layer takes data flow and divided them into
datagram
Transport layer send each datagram through Internet.
Division into smaller units could occur during this process
At the destination, datagram will be regrouped by network
layer to the original datagram and send it to transport layer
20
Figure 19.4
Network layer at the source
21
Figure 19.5
Network layer at a router
22
Figure 19.6
Network layer at the destination
23
Addressing




Need a standard address format
Address format must not dependent to
hardware address format
Address must be unique throughout the
network (Internet)
Body that regulate address registration–
Internet Information Center (InterNIC)
24
IP address (IPv4)


Represented by 32-bit integer
Use dotted decimal quad notation


Consist of 4 parts of 8 bit
Divided by dot
25
Network class

IP address is organized according to network class






Class A: 0nnnnnnn.iiiiiiii.iiiiiiii.iiiiiiii
Class B: 10nnnnnn.nnnnnnnn.iiiiiiii.iiiiiiii
Class C: 110nnnnn.nnnnnnnn.nnnnnnnn.iiiiiiii
Class D: 1110bbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb
Class E: for future use
Representation:



n – network number
i – host number
b – group id
26
Address range to identify the class
27

Each IP address divided into two parts



Network number (prefix) – shows physical
network that connected the computer
Host number (suffix) – shows computer unique
number at the network
Internet Corporation for Assigned Names
and Numbers (ICANN) responsible for
assigning class A, B and C to organisation
28

Class A, B and C are primary class


Class D is to multicast,



Used for normal host addressing
For broadcasting message
Class E is especially for future use
Each host has virtual interface address
which is known as loopback interface as
127.0.0.1

Also known as localhost
29
Figure 19.19 A network with two levels of hierarchy
30
Limitations in IP addressing
system



Some host has more than one address
Network class is too rigid
Not enough IP address for future
development
31
Subnet


IP address is organized as subnet to
simplify network management
Each subnet is a set of address that
determine by


Subnet address (exp: 199.17.35.96)
Subnet mask (exp: 255.255.255.240)
32
Subnet
A campus network consist of LAN for different
departments
33
Figure 19.20 A network with three levels of hierarchy (subnetted)
34
Figure 19.21 Addresses in a network with and without subnetting
35
Exp of Subnet
For network of Class B:
 3 bit is used as subnet to turn it into 15
subnet
 subnet mask: 255.255.224.0
 Other 13 bits represent host
36
Routing


If destination host is not at the same
network, datagram will be sent to gateway
How would IP choose its pathway to send
datagram to remote network?

Using routing table that contain next hop
information– that the other nod connected directly
to gateway
37
Example of routing table
netstat -nr
$ netstat -nr
Routing Table: IPv4
Destination
-------------------202.185.46.0
224.0.0.0
default
127.0.0.1
Gateway
Flags Ref
Use
Interface
-------------------- ----- ----- ------ --------202.185.46.197
U
1 25591 hme0
202.185.46.197
U
1
0 hme0
202.185.46.254
UG
1 80525
127.0.0.1
UH
3 137862 lo0
38
Figure 19.31 Default routing
39
Internet Protocol Version 6 (IPv6)




AKA Internet Protocol next generation
(IPng)
Address length added to 128 bit
Allow Web host addition to Internet
Allow Internet advancement
40
Diagnostic tools

ping



traceroute (microsoft: tracert)



To test connection to host
Measure round trip time
Show data flow from host to destination
http://www.traceroute.org/
netstat -nr

Show routing table
41


ipconfig (microsoft)
ifconfig -a (pd *nix)

To show IP, subnet and computer gateway
42
Tools

hostname


domainname


Computer name
Domain name
nslookup

Network and Server Information Tools from
Myloca (Telekom Malaysia)
http://www.myloca.net/cgi-bin/trace/index.pl
43