Tuesday, May 14, 2024
HomeJava10 factors on TCP/IP Protocol, Java Programmers ought to Know

10 factors on TCP/IP Protocol, Java Programmers ought to Know


TCP/IP is among the most essential protocol as its spine of HTTP, web and many of the communication occurs at present. It is also essential from technical interview perspective, you might need already seen distinction between TCP and UDP a number of time throughout interviews ( I’ve seen). I imagine each programmer, not simply Java developer ought to know what’s TCP/IP protocol? The way it works and the under factors I’m going to say. These are primary factors and most of you already know however throughout Interview I’ve discovered many builders who does not actually know what TCP/IP gives and the way it works and what are the professionals and cons of TCP/IP protocol. That is the place, I feel this text will allow you to. Anyway, let’s soar into technical particulars now. 

10 factors on TCP/IP Protocol, Java Programmers Ought to Know

Listed here are the ten important level about TCP/IP protocol each programmer ought to know and bear in mind. 

1) TCP/IP is a Connection oriented Protocol, which suggests connection is established earlier than sending information. Right here is how TCP/IP works and the way connections are established. 

2) TCP/IP maintains order of information, which suggests receiver will obtain information in identical order as sender has despatched to them. This prevents numerous out-of-order dealing with in software.

3) TCP/IP offers supply assure, which suggests no message is misplaced in transit. TCP/IP achieves this assure by acknowledgement. When Sender sends information, a TCP packet, it waits for receiver’s ack. If no ack obtained than it sends the information once more, until then it holds information in its buffer. When receiver responds, it additionally point out dimension of unused buffer and obtain window, to say how rather more information it could possibly settle for.

4) Every TCP/IP connection is recognized by mixture of native IP, native port, distant IP tackle and distant port. You should utilize netstat command to see all TCP/IP connection for a number. netstat works in each home windows and Linux.
$ netstat -na | grep tcp
tcp        0      0 0.0.0.0:7500                0.0.0.0:*                   LISTEN    
tcp        0      0 127.0.0.1:36655             127.0.0.1:1521              ESTABLISHED

Since TCP connection additionally has completely different state, you need to use them to search out solely ESTABLISHED connection or Server connection, that are listening. You possibly can test netstat command to be taught extra choices.


5) TCP No Delay and Naggle’s algorithm

This query was requested to me throughout an interview with a giant funding financial institution the place I used to be interviewing for a low latency Java developer position, primarily working with FIX protocol or creating related protocol.  You now might need guessed it that its associated to efficiency. 

Sure, Nagle’s algorithm is a method of enhancing the effectivity of TCP/IP networks by decreasing the variety of packets that must be despatched over the community and its managed utilizing an possibility known as TCP_NODELAY. 


6) TIME_WAIT state

This is among the state of socket which you will notice once you question utilizing Linux instructions like netstat. You’ll principally see the state with TCP connection and never with UDP connections as a result of there aren’t any states utilized in UDP, this column is normally clean.  TIME_WAIT state means  the socket is ready after near deal with packets nonetheless within the community.

7) Congestion management

8) TCP States

Listed here are the completely different states on which a TCP Socket might be. 
       ESTABLISHED
              The socket has a longtime connection.
       SYN_SENT
              The socket is actively making an attempt to determine a connection.
       SYN_RECV
              A connection request has been obtained from the community.
       FIN_WAIT1
              The socket is closed, and the connection is shutting down.
       FIN_WAIT2
              Connection is closed, and the socket is ready for a shutdown from the distant finish.
       TIME_WAIT
              TIME_WAIT state means  the socket is ready after near deal with packets nonetheless within the community.
       CLOSED The socket just isn’t getting used.
       CLOSE_WAIT
              The distant finish has shut down, ready for the socket to shut.
       LAST_ACK
              The distant finish has shut down, and the socket is closed. Ready for acknowledgement.
       LISTEN The socket is listening for incoming connections.  Such sockets will not be included within the output until you specify the –listening  (-l)  or
              –all (-a) possibility.
       CLOSING
              Each sockets are shut down however we nonetheless do not have all our information despatched.
       UNKNOWN
              The state of the socket is unknown.


9) netstat


10) sliding window protocol

That is one other key idea related to TCP connection and a helpful algorithms to know. As per Wikipedia, A sliding window protocol is a function of packet-based information transmission protocols.
Sliding window protocols are used the place dependable in-order supply of
packets is required, corresponding to within the information hyperlink layer (OSI layer 2) as
properly as within the Transmission Management Protocol (TCP).

That is all concerning the 10 important level about TCP connections each programmer ought to be taught and bear in mind. As I mentioned, TCP/IP and UDP are two essential protocol on the planet of computer systems and its used in all places. The truth is, HTTP relies upon TCP, therefore its crucial for each programmer or developer to find out about what’s TCP and the way it works in addition to instruments to cope with TCP connections for debugging and troubleshooting. 

Associated UNIX and Linux command tutorials for Java Programmers:

  • Find out how to name REST internet service from UNIX command line? (command)
  • 10 examples of discover command in UNIX (examples)
  • 10 examples of grep command in UNIX (examples)
  • The distinction between the comfortable hyperlink and onerous hyperlink in Linux? (reply)
  • UNIX command to search out the dimensions of file and listing? (command)
  • Find out how to get an IP tackle from a hostname and vice-versa in Linux (command)
  • 10 examples of tar command in UNIX (examples)
  • Find out how to how lengthy argument of a course of in Solaris (command)
  • 10 examples of Vim in UNIX (examples)
  • Find out how to create, replace and delete comfortable hyperlink in UNIX (command)
  • 5 examples of kind command in Linux (examples)
  • Find out how to make listing tree in a single command? (instance)
  • UNIX command to learn the way lengthy a course of is working? (reply)
  • 5 examples of kill command in Linux (examples)
  • 10 examples of chmod command in UNIX (examples)
  • 10 examples of xargs command in Linux (examples)
  • Find out how to delete empty recordsdata and listing in UNIX (resolution)
  • 10 tricks to work quick in UNIX? (suggestions)
  • 10 examples of date command in Linux (examples)

Thanks for studying this text thus far. If you happen to like this TCP/IP tutorial
and discover the knowledge helpful please share with your folks and
colleagues. In case you have any questions or suggestions then please drop a
notice. If you wish to be taught extra, you can even checkout these finest TCP/IP books and programs, I extremely suggest them if you wish to be taught in depth. 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments