Skip to main content
📚 College Credit Guide ✓ UPI Study 🕐 7 min read

How Does IPv4 Routing Work Between Two Networks?

This article explains how IPv4 routing works between two networks, from subnet checks and default gateways to hop-by-hop packet forwarding.

US
UPI Study Team Member
📅 November 20, 2026
📖 7 min read
22 views
US
About the Author
The UPI Study team works directly with students on credit transfer, degree planning, and course selection. We've helped thousands of students figure out what counts toward their degree and how to finish faster without paying more than they have to. This post is written the way we'd explain it to you directly.
🦉

IPv4 routing works between two networks when a host sees that the destination IP sits outside its own subnet, then hands the packet to a router that knows the next hop. That sounds simple, but students often miss one thing: the sender never guesses the route from the device name. It uses the destination IP, the subnet mask, and the router’s routing table. Here is the clean mental model. A host on 192.168.1.0/24 can reach 192.168.1.50 directly because both addresses fall inside the same /24 network. A host on 192.168.1.0/24 cannot reach 10.0.0.20 directly, so it sends the packet to its default gateway first. The router then checks its own table, picks an outgoing interface, and forwards the packet toward the next network. That hop-by-hop handoff is why routing exists at all. Ethernet works inside one local network, but IPv4 lets packets cross multiple networks, even across 3 or 4 routers, before they reach the final host. The source IP stays the same from start to finish, but the Layer 2 addresses change at every hop. That detail trips up a lot of students in an introduction to networking course, because they mix up the IP layer with the Ethernet layer. If you can follow one packet from sender to gateway to router to destination, you already understand the core of routing between two using IPv4 addressing.

Introduction to Networking
College credit · ACE & NCCRS reviewed · self-paced
View course
How Does IPv4 Routing Work Between Two Networks: learner traces a diagram beside a small device at a home office desk

How Does IPv4 Routing Between Two Networks Work?

The sender checks the destination IP against its own subnet mask, and if the two addresses do not match on the network portion, it sends the packet to a router instead of the final host. That decision happens in a fraction of a second, but the logic is plain: local traffic stays local, and remote traffic gets handed off.

The catch: The router does not care about the device name, and it does not forward based on the subnet mask alone. It reads the destination IP, compares it with entries in its routing table, and chooses the best next hop from there.

A student mistake shows up here all the time. They think the subnet mask itself tells the router where to send the packet, but the mask only helps the host decide whether the destination sits inside the same network. The router still needs a route entry, such as 10.2.0.0/16 via 172.16.1.1, to know what to do with the packet. Without that route, the router can only drop it or send back an error.

That is why an introduction to networking course spends so much time on network IDs, host IDs, and routing tables. The math matters. A /24 network gives 256 addresses, but only 254 usable host addresses, and that split helps you see why two devices can look “close” on paper while still living on different networks. A packet from 192.168.10.25 to 192.168.20.8 cannot cross directly, because the first host sees 192.168.20.8 as remote. It sends the frame to the gateway, and the gateway starts the real routing work.

The cleanest way to think about routing between two using IPv4 addressing is this: the host decides local or remote, the router decides next hop, and the packet keeps moving until one router sits on the destination network.

Why Do IPv4 Devices Need A Default Gateway?

A default gateway gives a host one fixed next hop for every off-subnet destination, so a laptop on 192.168.1.0/24 can still reach 8.8.8.8, 10.0.0.50, or any other remote IP through the same first router. Without that address, the host has no clue where to send traffic that falls outside its own network.

The subnet mask does the first check. A /24 mask tells the host that 192.168.1.99 is local but 192.168.2.99 is not, because the first 24 bits differ. That check happens before the packet ever leaves the device, and it happens on every send attempt, not just once at login.

Reality check: The default gateway is not the final destination for most packets. It is just the first router in the path, and that first hop matters because the host needs some router MAC address before Ethernet can carry the frame.

A weird but common error is this: students set the gateway to the destination server’s IP and wonder why nothing works. The gateway must be a router interface on the same local subnet, such as 192.168.1.1 for a 192.168.1.0/24 host. If the gateway sits outside the subnet, the host cannot even reach it to start the trip.

This is also where an Introduction to Networking course earns its keep, because the topic stops feeling abstract once you draw one LAN, one router, and one remote LAN on paper. The logic is old, stable, and brutally practical.

Introduction To Networking UPI Study Course

Learn Introduction To Networking Online for College Credit

This is one topic inside the full Introduction To Networking course on UPI Study — a self-paced online class for college credit. Credit recommended by NCCRS; your college decides how credits transfer. Courses start at $250 with no deadlines and lifetime access.

Browse IPv4 Routing Course →

Which colleges have matched Introduction to Networking? 16 colleges confirm UPI Study's Introduction to Networking (Computer Science 196, 3 credits), according to their equivalency pages on UPI Study. Here are 12 of them, with the course it counts as at each:

CollegeCourse it counts asCreditsHow it counts
Thomas Edison State UniversityITS-1400 Introduction to Networking3Transfers
Southern New Hampshire UniversityIT1ELE – Information Technology Elective3In SNHU's Work & Life Experience database
University of the PeopleCS 2204 Communications & Networking3Transfers
Post UniversityCIS 221 Networking Fundamentals3Transfers
Strayer UniversityIntroduction to Networking (CIS175)3Transfers
Columbia Southern UniversityITC 2302 Introduction to Data Communication3Transfers
Indiana TechCS 1330 Introduction to Networks3Transfers
UA GranthamIS216 (Computer Networks)3Transfers
University of Management and TechnologyCST 210 Data Communications3Transfers
Crestpoint UniversityGeneral Elective (Crestpoint)3Transfers (Elective)
Dunlap-Stone UniversityGeneral Education Technology3Transfers
Maestro UniversityNetwork and Internet Security3Transfers

Also confirmed by Newlane, Nexford, Pathways, Woodmont.

See Introduction to Networking on UPI Study →

ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Each college confirms the course when it evaluates your transcript.

How Does A Packet Move Hop By Hop?

One packet can cross 2, 3, or 10 routers, but the first move always starts the same way: the sender checks the destination IP against its subnet mask, sees that the target is remote, and sends the frame to the default gateway instead of the end host. From there, every router repeats a short routine.

  1. The sender checks whether the destination lives inside the same network, such as 192.168.1.0/24. If not, it prepares the packet for the gateway.
  2. The host uses ARP to find the gateway’s MAC address on the local LAN. That lookup usually finishes in under 1 second on a normal network.
  3. The host sends the Ethernet frame to the router, but the IP packet still carries the original source and destination addresses.
  4. The router strips the Layer 2 header, decrements the TTL by 1, and checks its routing table for the best next hop. A TTL of 64 becomes 63 after one router.
  5. The router picks an outgoing interface or next-hop IP, rewrites the Layer 2 header, and sends the packet onward. If the path needs another router, the same process repeats until the packet reaches the destination network.

Worth knowing: TTL exists to stop loops, not to slow you down. If a route loop keeps bouncing a packet forever, the TTL eventually hits 0 and the packet dies instead of circling the network all day.

That last part matters more than students expect. Routing feels magical until you trace each header change, and then it turns into a very ordinary relay race.

Which Address Fields Does Routing Use?

Routing depends on a small set of fields, and each one has a job. A host and a router both look at the same IPv4 packet, but they use different parts of it for different decisions, which is why one packet can cross 5 networks without losing its way.

Bottom line: The IP packet keeps its source and destination, but the frame around it changes at every hop. That split between Layer 2 and Layer 3 is the whole trick.

If you miss that split, routing looks confusing. If you see it, the process feels almost plain.

What Does A Simple Two-Network Example Show?

Picture two IPv4 networks: 192.168.10.0/24 on the left and 192.168.20.0/24 on the right, with one router between them. A host at 192.168.10.25 wants to reach 192.168.20.8, and the host’s mask says those addresses do not share the same network portion. That means the sender will not ARP for 192.168.20.8 directly. It will send the packet to the router’s left-side interface, such as 192.168.10.1, because that address lives on the local LAN.

That example exposes the most common misconception fast: the sender does not need to “know” the whole path. It only needs the local gateway, and then each router along the way makes its own 1-hop decision from its routing table. That is why routing between two using IPv4 addressing works even across longer paths, not just across one router.

A solid Introduction to Networking course often uses a diagram like this because one clean example beats 20 vague words. You can also pair it with Network and System Security if you want to see how routing, segmentation, and access control meet on the same wire.

Frequently Asked Questions about IPv4 Routing

Final Thoughts on IPv4 Routing

IPv4 routing looks technical at first, but the core idea stays small: a host checks its subnet mask, sends off-subnet traffic to the default gateway, and routers pass the packet along one hop at a time. Once you see that flow, the rest of the topic starts to make sense. The biggest mistake students make is treating the router like a magic box that knows everything. It does not. It reads the destination IP, checks its routing table, and sends the packet to the next network. The source IP stays intact, the Layer 2 addresses change, and TTL keeps the packet from looping forever. That is the real story. A good way to test your own understanding is to draw two networks, label one host on each side, and trace one packet with a pencil. Use the host IP, the mask, the gateway, and the router’s next hop. If you can explain each step out loud, you understand the path better than most students who only memorize terms for a quiz. Do one more pass with a simple diagram and a subnet mask, then trace the packet again from sender to destination.

How UPI Study credits actually work

Ready to Earn College Credit?

Credit recommended by NCCRS · Self-paced · Your college decides how credits transfer · $250/course or $99/month (US)

More on Introduction To Networking
© UPI Study. This article and its educational content are solely owned by UPI Study and licensed under CC BY-NC-ND 4.0. It is not free to reuse or modify. Any citation must credit UPI Study with a direct link to this page.

Comments

    No comments yet. Ask a question or share how it went for you.

    Leave a comment

    Comments go live straight away after an automatic check. Keep it kind and on topic, and please don’t post links, phone numbers, emails or other personal details. We remove comments that break these rules; use Report on any comment that does. Your email is only used to reply to you. Privacy policy