drdot
drdot

Reputation: 3347

What happens in the network when I access port on localhost using telnet?

My ubuntu machine's wireless interface is connecting to the wireless router. I wrote a simple web server listening on port 8888. I would like to understand how the packets are sent and receive using localhost. So I did the following experiment:

I started wireshark on the same machine listening wlan0 and on the terminal I type:

$telnet localhost 8888

Then I observe TCP SYN, SYN/ACK, ACK. In these messages, the MAC src and dest addresses are all 00:00:00:00:00:00. The src and dst IP addresses are all 127.0.0.1.

Does this mean these packet never go out from my wlan0 interface to the wireless router and directly loop back within my machine? Does it even reach my wireless card or just looping back within the ubuntu linux OS?

Upvotes: 0

Views: 273

Answers (1)

Amit
Amit

Reputation: 1885

The packets to localhost do NOT 'go out on wire'; i.e. the packets are send to receive buffers locally by the network driver.

IF you telnet to local server IP, then the packets do go out on wire. e.g. telnet 192.168.100.1 would make packets go out on wire.

Upvotes: 2

Related Questions