Jump to content

OSI Model

vgfan1995
Go to solution Solved by manikyath,

so... if your teacher failed to explain that you need a new teacher :P

 

i'll go over the entire model for stuff to make sense, and for future reference:

- layer 1: physical: electrical signals going over a cable, no "intelligence" implied.

- layer 2: Data Link: frames of data that dont directly have an implied routing path or content, but contain the next destination's mac address, so they can be semi-intelligently directed towards the right direction (what switches do)

- layer 3: network: this is where the entire packets of data come into play, with a described source, destination, priority, and a few other flags, this is the layer where routers work, to transfer packets to and from subnets, and to guide things in the right direction.

- layer 4: transport: this is where tcp/udp comes into play, basicly this layer is the "management" of data flow, making sure the data arrives as a coherent message.

- layer 5: session: kind of speaks for itself, this is the layer that takes control of a "connection" and monitors for timeouts, etc.

- layer 6: presentation: this is where the data sent over the network gets converted to and from something the end user can deal with. (https encryption/decryption, a game's packets getting turned into the individual data pieces, etc.)

- layer 7: the program on your screen.

- the undescribed layer 8: the end user. prone to errors.

5 minutes ago, vgfan1995 said:

Oh so switches and hubs are layer 2 and routers are layer 3. Could I classify router as layer 2 also because it also deals with MAC address?

you're looking at it the wrong way. a device cannot be "layer 3" without implementing the underlying layers.

 

you cannot have a switch without having cables (layer 1), as for the layer above that.

the best way to describe it is a "network stack" where copper is at the bottom, and every device has a "stack" of these layers up to the "intelligence" of the device (cables and hubs are layer 1, switches are layer 2, routers layer 3, etc.)

 

if a program on your computer does not have a UI, and does not process the data it sends and receives, but just has two sessions open and forwards between them, it's *basicly* only layer 5.

Could someone explain to me the difference between Layer 2 and Layer 3 in the OSI model? Thank you!

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, vgfan1995 said:

Could someone explain to me the difference between Layer 2 and Layer 3 in the OSI model? Thank you!

Layer 2 is things like your MAC address, Switches, things like that.

 

Layer 3 is the actual IP addresses and routing protocols. 

 

https://support.microsoft.com/en-us/kb/103884

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, legacy99 said:

Layer 2 is things like your MAC address, Switches, things like that.

 

Layer 3 is the actual IP addresses and routing protocols. 

 

https://support.microsoft.com/en-us/kb/103884

 

Oh so switches and hubs are layer 2 and routers are layer 3. Could I classify router as layer 2 also because it also deals with MAC address?

Link to comment
Share on other sites

Link to post
Share on other sites

Layer 2 (Data link) is the layer that provides a link between directly connected nodes. For example, two devices connected to a switch. It is used for MAC (Media Access Control) and LLC (Logical Link Control) on IEEE 802 networks.

 

Layer 3 is the Network layer. The primary function is IP address translation and routing protocols on the same network. Communication among multiple networks is performed at layer 4, where things like TCP sit in the internet stack. 

 

Most switches operate at layer 2, using MAC addresses, while routers typically allow for layer 3 and up functions (including layer 1 and 2, but not only). There are some layer 3 switches that have LAN routing functions, but they're not very common. 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, vgfan1995 said:

Oh so switches and hubs are layer 2 and routers are layer 3. Could I classify router as layer 2 also because it also deals with MAC address?

No, because a router needs to be configured on how to do its job were as a switch is generally plug and play 

 

Hubs and repeaters are actually layer 1 devices since they actually do nothing and are essentially "dumb"

Community Standards | Fan Control Software

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Black Out"

Ryzen 9 5900x | Full Custom Water Loop | Asus Crosshair VIII Hero (Wi-Fi) | RTX 3090 Founders | Ballistix 32gb 16-18-18-36 3600mhz 

1tb Samsung 970 Evo | 2x 2tb Crucial MX500 SSD | Fractal Design Meshify S2 | Corsair HX1200 PSU

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 16gb Gskill Flare X 3200mhz | Corsair RM550x PSU | Asus Strix GTX1070 | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, vgfan1995 said:

Oh so switches and hubs are layer 2 and routers are layer 3. Could I classify router as layer 2 also because it also deals with MAC address?

Broadly, yes. However, layer 3 switches do exist. (hubs are basically just broadcast devices and operate at layer 1).

 

If you're going by a strict definition of router on its own, the amount it deals with MAC addresses is fairly small. Most modern routers come with switches built in, but it's technically not being managed by the router itself. 

Link to comment
Share on other sites

Link to post
Share on other sites

so... if your teacher failed to explain that you need a new teacher :P

 

i'll go over the entire model for stuff to make sense, and for future reference:

- layer 1: physical: electrical signals going over a cable, no "intelligence" implied.

- layer 2: Data Link: frames of data that dont directly have an implied routing path or content, but contain the next destination's mac address, so they can be semi-intelligently directed towards the right direction (what switches do)

- layer 3: network: this is where the entire packets of data come into play, with a described source, destination, priority, and a few other flags, this is the layer where routers work, to transfer packets to and from subnets, and to guide things in the right direction.

- layer 4: transport: this is where tcp/udp comes into play, basicly this layer is the "management" of data flow, making sure the data arrives as a coherent message.

- layer 5: session: kind of speaks for itself, this is the layer that takes control of a "connection" and monitors for timeouts, etc.

- layer 6: presentation: this is where the data sent over the network gets converted to and from something the end user can deal with. (https encryption/decryption, a game's packets getting turned into the individual data pieces, etc.)

- layer 7: the program on your screen.

- the undescribed layer 8: the end user. prone to errors.

5 minutes ago, vgfan1995 said:

Oh so switches and hubs are layer 2 and routers are layer 3. Could I classify router as layer 2 also because it also deals with MAC address?

you're looking at it the wrong way. a device cannot be "layer 3" without implementing the underlying layers.

 

you cannot have a switch without having cables (layer 1), as for the layer above that.

the best way to describe it is a "network stack" where copper is at the bottom, and every device has a "stack" of these layers up to the "intelligence" of the device (cables and hubs are layer 1, switches are layer 2, routers layer 3, etc.)

 

if a program on your computer does not have a UI, and does not process the data it sends and receives, but just has two sessions open and forwards between them, it's *basicly* only layer 5.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Oshino Shinobu said:

Broadly, yes. However, layer 3 switches do exist. (hubs are basically just broadcast devices and operate at layer 1).

 

If you're going by a strict definition of router on its own, the amount it deals with MAC addresses is fairly small. Most modern routers come with switches built in, but it's technically not being managed by the router itself. 

the fun thing is, routers are actually layer 7 devices, because they do process all the way up to a UI for the end user to interact with, and manage the data flow.

 

the osi model isnt really an "enforced onion of layers" as much as it is a guideline of how to do things. if the end user application is stitching together frames to complete the packet it wants to receive and do layer 2 error handling... that's a recipe for disaster.

 

what the model basicly implies for modern computers is:

- the (copper) interconnect handles data flow

- the network interface (and its firmware & drivers) handle the sending and receiving of frames, error handling, etc.

- the network interface *then* stitches the frames together in packets, routing forward if needed

- the network drivers take care of making sure everything makes sense and is arriving as expected

- the program's network stack (there's that word again) takes care of keeping the connection alive, managing incoming and outgoing data, and reporting a disconnect.

- higher up the program's network stack messages are encoded and decoded

- all the way on top is the application itself, what the end user is "using"

- the end user.

 

or... in normal speak:

- grandma presses send email

- the email program of choice initiates the sending process

- the email is encrypted for privacy, compressed if possible

- connection to the email host is established, it is made sure that the host is *actually* the host, and transmit is initiated

- the email is split up into packets because we live in a packet switching world.

- the packets are sent along the most sensible routes at the time, most likely not all along the same path

- packets are split into frames for transmit

- electrical pulses travel over copper

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×