Hacker Fundamentals: A Tale of Two Standards « Null Byte :: WonderHowTo

If you read my article onthe OSI model, you got a good overview on communications from that model's perspective, but how does that relate toTCP/IP? We're going to take it a step further, getting into the idea behind thetwo address concept. How does an IP address and a MAC address work together? If you want tohijack sessionsand all sorts of lulz like that, you need to understand these concepts. Let's get into it, mates!OSI, TCP and What's Going on Here?A good way to understand what a protocol is, would be to view it like a language. If people were network interfaces and all spoke their own language, there would be no way for them to properly communicate. A protocol works the same way, by agreeing to use certain methods or standards, many groups can build and create things that can all communicate with each other. So when you seeTCP/IP protocol, think of it like a collection of rules computers must all follow to allow the millions and millions of networked machines called the Internet to function.OSI was never meant to be just a model. Back in the 1970s, it was a competing protocol against TCP/IP and was actually a better protocol in design. The main reason it didn't take hold was that its addresses werehexadecimaland very complex. In fact, it was thought back then, that it hadtoo manyavailable addresses. Being based in hex, it allowedfar morethan the current protocol standard of IPv4. I should point out that the next version of IP, version 6, uses hex addresses which allow many more available ranges then IPv4. Go figure.Examples of addresses include:Hexadecimal- 12:34:56:78:9A:BCIPv4 (current standard)- 74.125.225.98IPv6 (new format)- fe80::223:4eff:fec0:5b48A Tale of Two ModelsOSI is still used today to describe network communication and for standards to unite, while the TCP model is used to show relation between the various protocols it contains. Below is a diagram of how the two map out to each other.The first thing you might notice is that TCP/IP is not just one protocol, but an entire suite of protocols. Next, you should notice that the layers of the TCP/IP architecture and the OSI model line up more or less the same.Layers one and two of the OSI model are considered to both be physical and local, so they are simply grouped together as theNetwork Interface Layerunder TCP/IP. TheNetworklayer is just renamed theInternetlayer and carries the same functions. Following that, you can see layers five through seven of OSI have been compiled into theApplicationlayer, as that is where they operate.Still with me? Now let's take a look at all of these three- and four-letter abbreviations in the suite. This is the good stuff coming up here.The TCP/IP SuiteThe TCP/IP suite is where we talk about things likeFTP,DNSand other protocols you might have heard and read about before. Again, looking at the picture above, we can see what protocols are used in what layers.An entire book could be written on the TCP/IP suite—and they have. To keep things in focus, we are only going to discuss a few protocols here. Feel free to ask any other questions about the protocols in the comments.A good example of this is theTransportlayers of both the OSI and TCP models. When data arrives there, it has two options for transport, TCP and UDP. TCP allows for reliable transit, where as UDP is unreliable. If you are wondering why you would ever want to send something unreliable, here is the answer...TCP vs. UDPIn avery short nutshell, when you send a request with TCP, you will always get a confirmation of its receipt. This is like me throwing you a ball, you yelling "I got it!", then throwing it back to me, where I would then yell "I got it". But what if I drop it? I would simple yell back, "I need it again!", and would wait until you threw me a new one.In contrast, UDP is like you throwing me ball after ball and just hoping I catch them. If I drop one or sixteen—it doesn't matter—because you have no way to know.UDP sounds pretty bad right now, but listen to this: services likeVOIPand online games are too fast for TCP. Imagine you were playing Halo and you dropped a packet or two. Can you stop and wait for it? Of course not. You would see a little jump in the frame rate and you'd keep going. If you had to wait for it to get back to you, you would surely be fragged. The same applies if you were talking to your mate on Skype and you dropped a few packets; it makes no sense topausethe conversation to retrieve them.TCP is great when you need to make sure all the packets arrive and in order. Web browsing and the like would be awfully hard without having reliable transportation.It is theTransportlayer that determines, based on its parameters, what protocol to use.IP and MAC AddressesEvery single packet being sent around has two addresses inside of it—anInternet Protocoland aMedia Access Controladdress. An IP address really only identifies your network, as all internal IP addresses are actuallyprivateand handled by Network Address Translation (NAT) at the router. You might have an IP address from your ISP of201.95.87.98that identifies your network, and your actual computer might have a private, inside-the-network address of192.168.1.67.This is done so that many devices, like your PlayStation and your computer, can get on the Internet at the same time, while only needing one IP address. If every single device online today had its own address, we would have already ran out of new ones to use!So, where does a MAC address come in? As it is, IP addresses are of no use inside of your network, as your machines don't use them to talk to each other.Where IP addressing functions at the network layer, MAC addressing works at the data link layer. It's a slight oversimplification, but one can think of IP addressing as supporting the software implementation and MAC addresses as supporting the hardware implementation of the network stack. The MAC address generally remains fixed and follows the network device, but the IP address changes as the network device moves from one network to another.So, how in the world does this actually work? Your network maintains a mapping between the IP address of a device and its MAC address. This mapping is known as the ARP Table.Putting It All Together: Address Resolution ProtocolARPstands forAddress Resolution Protocoland it is used to associate aNetworklayer address (IP address) with aData Linklayer address (MAC address).Let's say you have some data to send. When the data gets to theNetworklayer, it will put on the destination IP address. All of this info (theNetworklayerdatagram, aka packet) is passed down to theData Linklayer where it is taken and placed within a data link frame.Based on the IP address and subnet mask, your computer should be able to figure out if the destination IP is local to your network or not. If the IP is local, your computer will look in its ARP table, the table where the responses to previous ARP requests are cached, to find the MAC address.If it's not there, then your computer will broadcast an ARP request to find out the MAC address for the destination IP. Since this request is broadcast, all machines on the network will receive it and examine the contents. If the IP address in the request is their own, they'll reply back. On receiving this information, your computer will update its ARP table to include the new information and will then send out the frame addressed with the destination hosts MAC address.Request for CommentsWith all this talk about protocols, I'm sure you have some questions about specific ones you have come across. It turns out theInternet Engineering Task Forcehas put together a memorandum describing, collecting, and categorizing details about protocols, research, and ideas on how the actual Internet functions. This is needed because there's no one authority that mandates certain protocols to be used over other ones, and in fact, you can create and submit your own for review and use!Want to learn the more technical components ofUDP,ARPandTCP? Check out those RFC white papers describing the protocols.In ClosingWe are another step further in giving you the skills you need to navigate the Internet like a pro. If some of this didn't quite make sense, I encourage you to check out ourOSI modelandIntro to IP Addressesarticles for some more back knowledge. Next in the series, we will look at penetration attacks that work on these ideas!Questions? Comments? Have anything to add to this walkthrough? Leave us a comment or visit ourforumand share it with the community.Want to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseImages byNetFaq,SoftPanorama,Network Cable TesterRelatedHacker Fundamentals:The Everyman's Guide to How Network Packets Are Routed Across the WebNews:How to Study for the White Hat Hacker Associate Certification (CWA)How To:The Essential Skills to Becoming a Master HackerHow To:Draw InuYashaHack Like a Pro:Linux Basics for the Aspiring Hacker, Part 16 (Stdin, Stdout, & Stderror)News:Becoming a HackerHack Like a Pro:Digital Forensics for the Aspiring Hacker, Part 1 (Tools & Techniques)How To:Break into the Lucrative World of Ethical Hacking with This Reasonably Priced Course BundleHow To:Draw Prince Arren (Tales from Earthsea)News:Children's Book Classic Peter Rabbit & Other Tales Come to AR via iOS AppHow To:Become an In-Demand Web Developer with This $29 TrainingHow To:The FBI Can Spy on Your Webcam Undetected: Here's How to Stop ThemHow To:Convert a standard SIM card into a MicroSIM cardHow To:Teach Blocking Fundamental for Young Football PlayersNews:Escape Room Experience Comes to Mobile via Futuristic 'The Lockdown' Augmented Reality GameHow To:Draw a Boat in Two Point PerspectiveWhere Do I Start:Learn the FundamentalsAdvice from a Real Hacker:The Top 10 Best Hacker MoviesNews:"Rat Tales" by the old surfer man BarettaNews:Bring the Brothers Grimm Characters to Life This HalloweenHow To:learn TIG FundamentalsHow To:Old Wives' Tale or Science? 20 Snacks That Just Might Make You SleepyNews:Should district be allowed to demand middle-schooler's Facebook password?WTFoto of the Day:The Tragic Tale of OedipusWATCH THIS INSTEAD:HopNews:TANGLED - A Disneyological StudyNews:When Foursquare Gets CreepyNews:Indie and Mainstream Online Games Shut Down by LulzSecNews:Dark Side of the Lens - DP Allan WilsonHow To:Networking Basics for the Aspiring HackerNews:Cooks IllustratedNews:US Federal Gov’t ‘Waging War’ on WhistleblowersNews:Lombardi on Technique and FundamentalsNews:Minecraft World's Weekly Workshop: Reverse Engineering Minecraft Cake DefenseHow To:How Hackers Use Your IP Address to Hack Your Computer & How to Stop ItNews:"This Guy Has My MacBook"—A Tale of Evil, Redemption & the Power of the AppNews:Time-Saving Tricks for Working Smarter and Faster in 3ds Max 8News:How-to-jog-your-memory-the-science-fiction-hero-wayNews:7 Disney Movies Based on R-Rated StoriesNews:Anonymous Hackers Replace Police Supplier Website With ‘Tribute to Jeremy Hamm