Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Putty's "raw" TCP connection

connection

  • Please log in to reply
4 replies to this topic

#1 7SLEVIN

7SLEVIN

    CC Newcomer

  • Member
  • PipPip
  • 23 posts

Posted 27 October 2011 - 03:42 AM

Hi

Can anyone explain to me what this actually is?
And from what i can understand from Putty's documentation, under "Making raw TCP connections", there seems to be a differens between theirs and UNIX's telnet?


Thanks for all help,
Slevin
  • 0

#2 fkl

fkl

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 417 posts

Posted 27 October 2011 - 11:40 AM

I am not very sure what you are confused about. So let me explain what i think confuses you.

There are protocols on each layer with different responsibility i.e. telnet, ssh, smtp, http are all application layer protocols. Each common tcp/ip packet generally has one header from each layer i.e. application layer(telnet, smtp, http and many others) , transport layer (tcp or udp), network layer(ip v4/v6, icmp, igmp etc.) and link layer (ethernet, sip etc.)

A standard putty connection uses application layer. If you using encryption, it is SSH which is a complete protocol. If not, then it is telnet (which basically is a protocol for executing your commands on the remote machine from command prompt, SSH does the same but it encrypts the communication where as telnet is plain text). Note that telnet is still a protocol which means it would have SOME standard messages to follow (something like hello, byte x means y, byte z means k) etc.

Compared to this, when it says "raw tcp connection", this means there is NO APPLICATION layer. You can define on your own what messages in application header each side (sender / receiver) would have and what would they mean. This is similar to having written a tcp sockets based client server in which you have a connected socket and use read or write to exchange data between them both. Now you can use these read writes to turn into any application layer protocol. Again HTTP, SMTP etc. are mere fixed standard format of application layer messages. If the client always sends a message containing a "GET request" with server responding with a "200 OK" or "404 not found", this is application layer header of HTTP.

If you have two raw tcp connections (a client connected to a server) you can devise a protocol of your own.

On the post you referred to, it is mentioned that Linux telnet is not really telnet. It means that if you try to DEVIATE from telnet protocol using putty and exchange messages in your own format, it is acceptable. It is just that if you follow telnet standard, it recognizes, accepts and starts responding according to telnet protocol.

Let me know if i am not clear any where.

regards,
Fayyaz

Edited by fayyazlodhi, 29 October 2011 - 02:42 AM.
typos

  • -1
Today is the first day of the rest of my life

#3 7SLEVIN

7SLEVIN

    CC Newcomer

  • Member
  • PipPip
  • 23 posts

Posted 29 October 2011 - 02:20 AM

Thanks! Explained perfectly, kudos :)

How would you go on with setting up a raw connection from a linux shell then?


Slevin
  • 0

#4 fkl

fkl

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 417 posts

Posted 29 October 2011 - 02:35 AM

Just ensuring that i got your question right.

Similar to typing $: telnet ip ..... from shell, you are asking for a way to still establish a connection but without telnet i.e. raw tcp.

Like shown previously, putty provided one possible way.

There are other utilities which come prepackaged on Linux

For example nc (net cat i think is one). I use it pretty frequently and is very rich in format.

$ nc localhost <port> <enter> // this tries to connect to a server listening on local host on <port>
hi there <enter> // if the server is also nc it simply echoes the message on screen

$ nc -l <port> // listens for tcp connections on <port>

By default nc uses tcp but you can specify udp with -u. It is very extensive. Check out the man page, you could specify ipv4 / v6 with a lot more.

I am sure there would be other utilities too.

To make it more understandable, you can do nc <ip> <80> for google.com. Then if you send get message, effectively you are doing http protocol. Same applies to telnet. This is a good utility to quickly go through each message of any application layer protocol.

Hope that helps.

regards,
Fayyaz

Edited by fayyazlodhi, 29 October 2011 - 02:38 AM.
typos

  • 0
Today is the first day of the rest of my life

#5 7SLEVIN

7SLEVIN

    CC Newcomer

  • Member
  • PipPip
  • 23 posts

Posted 30 October 2011 - 06:41 AM

Ah i see! I will definitely be trying it out.

Thanks again Fayyaz ;)
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download