Layer 3 - network layer.
Sub-netting in the OSI model is a layer 2, or network layer, concept. At layer 2, you start thinking about network routing, and how it relates to sub-netting. At layer 3 and above, you only think about destination address and you let the layer 2 stuff handle any required routing.
The routing process occurs in the 3rd OSI layer (network layer) routing protocols use network address (IP address in TCP/IP) to chose the correct path to the destination. ps: You can also have routing protocols on other layers sometimes (application layer in p2p routing) but this is something completely different.
Routers don't use MAC addresses for routing. They use IP address.
Framing is done at the Data Link layer (Layer 2). Routing is done at the Network layer (Layer 3).
Routing protocols implement algorithms that tell routers the best paths through internetworks. Routing protocols include Border Gateway Protocol (BGP), Interior Gateway Routing Protocol (IGRP), Routing Information Protocol, and Open Shortest Path First (OSPF) to name a few. Routing protocols provide the layer 3 network state update. Routed Protocols are transported through a network, such as Internet Protocol (IP), Novell Internetwork Packet eXchange (IPX), and AppleTalk.In short, routing protocols route datagrams through a network. Routing is a layer 3 function, thus, routing and routed protocols are network-layer entities. Routing tables on the layer 3 switch (router) are populated by information from routing protocols. A routed protocol will enter an interface on a router, be placed in a memory buffer, then it will be forwarded out to an interface based on information in the routing table.
The IP address and the subnet mask are required in layer 3 for routing purposes.
routers work at layer 3 (network) which usually means TCP/IP. Routing decisions are made based on a packets DESTINATION IP address.
Enabling routing on a layer 3 switch.
network layer
The network layer is the layer that is responsible for routing packets on the network. This is the layer in which Internet protocol operates. In the seven layer OSI model, the network layer is the third layer from the bottom.
ip route prefix mask address
Enabling routing on a layer 3 switch.