Friday, August 15, 2014

Basics of TCP, UDP & Common used Ports

TCP
Transmission Control Protocol

It is the Transmission Layer Protocol  and was created to maintain communication.

TCP takes large  block of information from an application and breaks them in to different segments. It is a Connection Oriented Protocol means stable in connection with applications.

A connection oriented protocol is used in TCP have the establishment sequence in three-way handshake type. It allows the system to exchange information such as initial sequence number, windows size and other TCP parameters between client and web server. It happens prior to data transmission.

The TCP Segment works for Internet Layer, sending of packet from one source to destination. A TCP Header is 20 bytes long or up to 24 bytes with options.

There are some other protocols used for applications which are as:
Telnet, SMTP, HTTP, FTP, DNS, HTTPS, SSH, POP3, NTP, IMAP4


A Typical Segment or TCP Frame is as :-



Size of the frame:-
1. Source Port : 16 bit
2. Destination Port : 16 bit
3. Sequence Number : 32 bit
4. Acknowledgement No : 32 bit
5. Header : 4 bit
6. Windows Size : 16 bit
7. Checksum : 16 bit
8. Urgent pointer : 16 bit
9. Options : multiple of 32 bits

On the other  features are as : - 
  • It  is Sequenced
  • Reliable 
  • Acknowledgement 
  • Connection-oriented 
  • Window  Flow Control
  • Error Free Data Transfer
  • Congestion Control
  • Re transmission of  Lost packets.
  • It Uses Virtual Circuit for establishing a connection.
The SYN and ACK flags are very important for the connection-oriented session establishment. When SYN bit is set, it means synchronize the sequence numbers (during connection setup), while ACK bit is used to indicate that the value in the acknowledgment field is valid. And then the ACK replied by the web server acknowledges the receipt of the web browser’s SYN message.

Configuring IP Address for IPv4 system. Just a basic knowledge. 


An IP address or Internet Protocol Address is a numerical level assigned to each device.

UDP: User Datagram Protocol

UDP is a connectionless and unreliable data delivery service with 32 bit structure. It have no error recovery, no sequencing, no recording, no acknowledgement, no congestion control.

Applications use UDP are tolerant to data lost during video streaming kind of transmission and handles their own reliability.

One advantage in UDP that it supports Multiplexing. 

Different types of Ports

A port is a communication point or one endpoint. The port number is a 16-bit unspecified integer, ranging from 0 to 65535. 

In networking some common port numbers used such as;

  • Port no 20 & 21: Used for FTP (File Transfer Protocol)
  • Port no 22: Used for SSH
  • Port no 23: Used for Telnet
  • Port no 67/68: Used for DHCP
  • Port no 80: Used for HTTP
  • Port no 443: Used for HTTPS
  • Port no139 and 445: Used for SMB
  • Port no 53: Used for DNS
  • Port no 110: Used for POP3
  • Port no 25: Used for SMTP
  • Port no 8080: Used for Internet
  • Port no 123: Used for NTP server
  • Port no 161: Used for SNMP
There is always a common delusion that an open port is dangerous. This is largely due to lack of understanding into the use of open ports. Open ports are important to communicate transversely in the Internet. However, an open port can be dangerous when the service listening to the port is not patched, is exploitable, misconfigured or has poor network security policies.



-DR

Network Scanning Tools

Network Scanning through Nmap and Nessus Network scanning is a process used to troubleshoot active devices on a network for vulnerabilities....