430 likes | 449 Views
DETAILS OF PROTOCOLS. The Zoo Protocol TCP IP. 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. Transmission Control Protocol (TCP).
E N D
DETAILS OF PROTOCOLS The Zoo Protocol TCP IP ravie@ftsm.ukm.my
A programmer can create Internet application software without understanding the underlying network technology or communication protocols- we will take a different approachUnderstanding the Zoo Protocol
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
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
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)
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.
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
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
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
Ending TCP connection • TCP uses FIN segment for ending the connection • Four-way handshaking
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]
UDP Datagram Format • Header • Source UDP Port (16 bit) • Destination UDP Port (16 bit) • UDP message length (16 bit) • UDP Checksum (16 bit) • Data
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
IP responsible in providing best-effortsendingfor 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
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)
IP address (IPv4) • Represented by 32-bit integer • Use dotted decimal quad notation • Consist of 4 parts of 8 bit • Divided by dot
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
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
Class A, B and C are primary class • Used for normal host addressing • Class D is to multicast, • 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
Limitations in IP addressing system • Some host has more than one address • Network class is too rigid • Not enough IP address for future development
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)
Subnet A campus network consist of LAN for different departments
Figure 19.20A network with three levels of hierarchy (subnetted)
Figure 19.21Addresses in a network with and without subnetting
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
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
Example of routing tablenetstat -nr $ netstat -nr Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 202.185.46.0 202.185.46.197 U 1 25591 hme0 224.0.0.0 202.185.46.197 U 1 0 hme0 default 202.185.46.254 UG 1 80525 127.0.0.1 127.0.0.1 UH 3 137862 lo0
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
Diagnostic tools • ping • To test connection to host • Measure round trip time • traceroute (microsoft: tracert) • Show data flow from host to destination • http://www.traceroute.org/ • netstat -nr • Show routing table
ipconfig (microsoft) • ifconfig -a (pd *nix) • To show IP, subnet and computer gateway
Tools • hostname • Computer name • domainname • Domain name • nslookup • Network and Server Information Tools from Myloca (Telekom Malaysia) http://www.myloca.net/cgi-bin/trace/index.pl