LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2020, 08:04 AM   #1
yangyiin
Member
 
Registered: Nov 2018
Posts: 44

Rep: Reputation: Disabled
port number information


Hi,
In ethernet frame is included the port number by the sender?
I mean let`s say for ssh connection -ssh user@host-every ethernet frame contain number 22 as port information?
or http://host:8080 ->contain 8080 in the frame?
 
Old 10-22-2020, 08:10 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
Sender port does not have to match destination port. The destinations are well known so that clients know how to make a connection. The sender port is included so the server knows where to send the reply. Note that ports are not in the ethernet header, they are part of the higher-level TCP/IP protocol.
 
2 members found this post helpful.
Old 10-23-2020, 02:36 AM   #3
yangyiin
Member
 
Registered: Nov 2018
Posts: 44

Original Poster
Rep: Reputation: Disabled
the port number is in data in ethernet frame.right?
 
Old 10-23-2020, 04:54 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The Ehernet frame contains IP information, which contains TCP or UDP information. The port is part of TCP/UDP. So, yes.
 
Old 10-23-2020, 05:51 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,657
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
It's called encapsulation. An application (say a browser) creates a packet with a header. The protocol which decides what goes in the header would be something like http.

This packet then becomes the body of a tcp packet with a new tcp header that would carry the sending and receiving ports.

The tcp packet then becomes the body of an ip packet with a new ip header containing the sending and receiving ip addresses.

Finally the ip packet becomes the body of an ethernet packet with a new ethernet header containing the sending and receiving machine addresses. There will be a lot of unwrapping and rewrapping of this last envelope on the way to the final destination.

When the ethernet packet reaches its final destination, all the headers are taken off one by one to reveal the original http packet, which the browser can understand and respond to.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Port number used by server when using dynamic port forwarding in SSH? kreeder Linux - Networking 4 11-21-2011 02:07 PM
Identify and explain the major number, minor number, and revision number in Linux... turbomen Linux - Newbie 1 11-16-2010 02:48 AM
USB to serail port adaptor COM port number areftaidi Linux - Software 2 09-25-2007 01:05 AM
forwarding ssl port to a different ssl port number on a different machine coal-fire-ice Linux - Networking 6 03-15-2007 12:30 PM
Hiding machine information and root information geletine Linux - Security 6 07-14-2006 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration