----BEGIN CLASS---- [14:00] #startclass [14:00] Roll Call [14:00] Jason Braganza [14:00] kiyo [14:00] Saransh Sood [14:02] ok it’s just the three of us then :) [14:02] good evening peopl [14:02] hello [14:02] have you both read through the chapters? [14:03] yes [14:03] kiyo, specbeck, how familiar you folk with networking ? [14:03] firewalls? [14:03] in general [14:03] i think i'm pretty good at networking [14:04] but not so much with firewalls [14:04] Tiny bit [14:04] specbeck, tiny bit of what? [14:04] Networking [14:05] specbeck, kiyo then firewall wise, i’d recommend this - read through that chapter. but don’t use iptables. understand the basics. and then use some frontend that is simpler [14:05] the chapter is there for you to give you a kind of under the hood peek [14:05] ! [14:06] use firewalld on fedora or ufw on ubuntu to get stuff done.= [14:06] only if you have esoteric needs would you ever need to drop down to the iptables level [14:06] next [14:06] does tracerouth or trace path [14:07] does it go through all the networks untill i hit my host? [14:07] specbeck, in the meanwhile, give me gist of what you understand about networking, and i’ll try to build up from there [14:07] so as fas as i know first its my lan then... [14:07] traceroute* [14:07] kiyo, then the router it hits tells it where to go next [14:08] some of the domain names seem interesting [14:08] i guess thats the "internet" at that point but not sure [14:09] and the router knows what it knows based on the gateway *it* has and the routes folks have either fed into it or the routes it has detected via lower gateway level protocols like bgp [14:09] i just imagine its using the ips of all the networks until it hits my destination [14:09] not really :) that would take too long. [14:09] As far as I know, networking is concerned with systems connecting to the servers to access data using the IP addresses of the corresponding systems [14:09] so most routers and build up caches as they work [14:10] kiyo, specbeck so let’s focus on me sharing what i know about networking basics with you this evening [14:10] ok [14:10] Okay :) [14:11] and firewalls you experiment with and ask in the channel. [14:11] so there is point a and point b [14:11] and point c and point d [14:11] and then there were various ways of connecting them. [14:12] you could just connect them one after another like a chain of buses one behind the other [14:12] or you could connect them all to a central hub, to form a star with stuff radiating out from the center [14:12] so those are physical topologies. [14:13] one is called the bus. [14:13] and the other a star [14:13] very imaginative, i know :) [14:13] yea :D [14:13] ... [14:13] there must have been others, but i forget them :) [14:13] these were the more popular ones [14:13] kiyo? [14:13] sorry nothing [14:13] just star and bus [14:14] aah :) [14:14] now that is how you *physically* connect them. [14:14] and lets assume all of this is in the same room [14:14] we can go out to separate rooms / floors / buildings later [14:15] so the centre of our star is a device that was originally called a hub [14:15] a network hub [14:15] and next level up comes the decision of *how* stuff would pass on the wires [14:16] sorry glitched a bit. back [14:17] so the way of sending data on the wire, the most popular way is called ethernet [14:17] there was arc net [14:17] and token ring bus [14:17] and they are dead [14:18] ethernet uses something called csma/cd [14:18] some one will have to look that up, but to the best of my recollection it stands for carrier sense multiple access / collision detect [14:19] which means i can send ethernet data (frames) across the network to everybody [14:19] and it will just pass from machine to machine [14:20] until some network interface that sees its “tag“ - what we call MAC IDs now [14:20] and then that one will respond saying hey! this data is mine [14:20] ! [14:20] and if many people on the network talk at once, they all back off. [14:21] and try again after varying amounts of time [14:21] next [14:21] Is a MAC address now called a MAC ID? [14:21] MAC address / MAC ID - potayto / potahto [14:21] hehe ok [14:22] I like to be as conventional as possible its TLS error for me now too! [14:22] a TLS error is a MAC ID? [14:22] now these ids can be changed on the fly by operating systems and the cards themselves [14:23] no as in i like to be strict so I try not to use ssl and use tls now [14:23] if MAC ID is the new "correct" way i will follow that. [14:23] how is that related to MAC ID? or networking? [14:23] no no no [14:23] we are way down the stack! [14:23] don’t depend on mac addresses for identification :) [14:24] these are easily spoofed in this day and age [14:24] i am just building up from the wire up :) [14:24] so ethernet frames are how data passes in its rawest from [14:25] all network equipment understand ethernet [14:25] the smarter and more powerful they get, the more they understand about the network stack [14:26] so let’s climub up one more layer [14:26] rather than just pew pewing ethernet frames however we want, we can send them across in sume structured manner [14:26] that is what a network protocol does [14:26] send stuff from here to there in an agreed upon manner [14:27] there were many many many protocols once upon a time [14:27] Novell would use IPX (interntwork packet Xchange) for it Netware networks [14:27] Digital used DECTalk [14:27] Apple had AppleTalk [14:28] 3Com had something [14:28] IBM was doing its own thing with token ring networks instead of ethernet and some proprietary protocol [14:29] Banyan used Vines [14:29] plenty more [14:30] so the world as such would talk on their own networks using their own protocols [14:30] and more and more there was this thing of how do i get a DEC machine in this place to talk to that IBM machine in the other building? [14:31] the US government solved that by funding DARPA who funded an array of universities [14:31] IP was the open protocol that emerged out of all this [14:31] and suddenly there was something that every one could speak. if they wanted too [14:32] and as folks began hitching their networks via ip gateways to each other [14:33] a common scenario would be my novell netware network at my factory talks to an ip gatway which is connected to my head office ip gateway which is then talking microsoft netbeui or whatever microsoft was upto. [14:33] and then slowly ip made inroads into the networks as well, because it was just easier for everyone to speak ip [14:34] now IP could route packets from one place to the other (on top of whatever was beneath it.) [14:34] think of your home [14:35] ip rides over wifi, to your router where it hops to the other side and then travels over ethernet or Fibre to your ISP [14:35] and then over some other media to the big trunk provider [14:36] so you no longer have to worry about whether you are riding on analog telephone lines or ISDN lines or fat ethernet pipes [14:36] IP can work over any of these [14:37] now in the interest of saving computation [14:37] there are two sub protocols that ride on top of IP [14:37] if i want to know that my data *has* reached its destination [14:37] i will use TCP [14:38] that’s what we use for most of our point to point stuff. web traffic. or mail. or ssh. [14:38] and sometimes i just don’t care [14:39] i want to be able to send out a blast. and i am ok if stuff reaches or not. a few missed packets are alright [14:39] imagine audio or video streaming [14:39] so i’d use UDP for that [14:39] so that in essence is the prevalent stack. TCP/IP (UDP/IP) [14:40] with me so far? [14:40] questions? [14:40] yes [14:40] YEah [14:40] None [14:40] ! [14:40] so at least now you can visualise how stuff travels over the wire [14:41] let’s dig a tiny bit into TCP/IP [14:41] next [14:41] so is traceroute just going from gateway to gateway of all the ip connected devices. [14:41] tada :) [14:41] ! [14:41] next [14:42] i'm almost to affraid to ask but is there a central network after my ISP that is "the internet" [14:42] or does it go further than that [14:42] of course there is :) [14:43] all the big fat data pipe providers are in fact “the internet“ [14:43] how many layers above the isp are there? [14:43] so it used to be layer 3, and cisco and lots of telecom providers [14:43] who woould invest in infrastructure and lay pipes and cables across oceans [14:43] now a days it’s Google too :) [14:44] ! [14:44] who link lots of trans oceanic places [14:44] even facebook does this [14:44] and most major telecome companies have the bandwidth [14:45] which is how a country’s government can shut down the internet in places they don’t want folks to have access to information [14:45] next [14:45] sorry to be a pain... but i guess at the highest level there is no longer a "gateway" there is some other network strategy. [14:45] it’s been far too long [14:45] but at the highest level if i remember right, is the US government. [14:46] because it all started with the networks that they spawned [14:46] they have slowly been letting go of access to critical parts of the Internet’s infrastructure to non governmental agencies [14:47] ICANN is one that comes to mind [14:47] so each area of the world has some similar presiding agency that is ideally supposed to be working as a non partisan agency for the good of the people of the region [14:48] https://en.wikipedia.org/wiki/ICANN#Representatives [14:48] and that is the miracle that I spoke about in my session on open source all these weeks ago [14:49] no one in their right minds would try to block something that has given us so much progress [14:49] or enables us so much [14:49] it’s a delicate balance [14:49] lets hope so... [14:50] i had these questions when i used to configure the internet for my clients in 97 [14:50] it has been 25 years now :P and then net was there for close to a decade and a half before that [14:51] at this time it’s safe to say the Internet is Lindy :) [14:51] every day that passes increases the frequency of the net surviving another day :) [14:51] and yes everything can crash tomorrow. [14:52] covid showed us that, when everything else crashed other than the internet [14:52] ! [14:52] but stuff finds a way [14:52] next [14:52] specbeck, is tihs fascinating or are you bored? [14:53] No, very fascinating... [14:53] i'm probably so wrong here but even if some of the networks go down it will just affect the ip ranges they are responsible for right? [14:54] kiyo and now you are hitting on why the us military designed it that way in the first place [14:54] multiple links [14:54] so in the mothership network that the us controlled lost one of its connected networks that was responisble for 11.x.x.x [14:54] multiple ranges [14:54] so everything can never die at once [14:54] so back to TCP/IP [14:55] in the early days it was simple [14:55] the rich nations had a lot of ips [14:55] the poor nations had none [14:56] stanford university for example has a bigger block of ips than all of india [14:56] so in many places, ips began getting exhausted [14:56] which is why CIDR came into play https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing [14:57] the discussion of ips and subnetting is beyond the scope of our session here [14:57] so suffice to say [14:57] there are ranges of ips that we can use for our private networks [14:58] and the rest are for use on the public internet. [14:59] so if you are ever exposing your machines to the net and you have multiple ips to assign to them (highly unlikely in this day and age :)) you will use subnetting and CIDR [14:59] if you are administering a *large* network that is geographically spread, then you will use subnetting and CIDR and routing [15:00] but for a tiny home network, you just assign a ip to every machine [15:00] and you are set [15:00] now for a machine to talk to others on the network [15:00] you need two other bits of information [15:01] one is a name resolver if you are calling your machine by a name instead of ip [15:01] so if you are called bugs and your other machine is called daffy there has to be something that will map a name to an ip address [15:02] that used to be a file called the hosts file [15:02] you can see it in every machine [15:02] on linux machines it is /etc/hosts [15:03] now a days you just delegate all this name mapping to a program called a dns resolver [15:03] it will look at your hosts file [15:03] and if it is not there, it will look to a set of “root” servers [15:03] and work its way downwards from there [15:04] now how will a resolver find its way to a root server? [15:04] excellent question [15:04] you need another machine called a gateway [15:04] or device [15:04] which will connect to the world at large [15:04] that is your router [15:04] or something your office provides [15:04] or your cell service provides [15:04] which means [15:04] if you have no access to the net [15:05] you have to run a dns server of sorts that will map names to ips for every machine in your network [15:05] or no one will able to access each other by names [15:05] (we could access by ips without any problem though) [15:06] os [15:06] oops [15:06] so [15:06] once i have my trifecta, an ip address, a dns resolver address and a gateway address, i could in theory, if everything is working, speak to any machine in the world [15:07] which is how i am talking to you :) [15:07] now, it is going to be very tedious, if i had to type this thing over and over and over again for every machine i want to connect to my network [15:08] which is where another protocol called dhcp (Dynamic host configuration protocol) comes in [15:08] you give it a range [15:08] of ips [15:08] and you give it other bits of sundry information [15:08] and it will then assign that to every client that talks to it [15:09] so every new machine now first talks dhcp. every networking devices probes the network for a dhcp server on the local network that it finds itself on [15:09] and once it finds one, it’ll query it for information [15:10] now a days even a cheap 1000 rs router will do all this for use [15:10] it will connect all my ethernet devices, it will provide a medium for wifi, it will route information between two disparate networks and provide dns and dhcp services [15:11] so my phone comes on, talks to the my router, the router says aah here have this ip address for your use, oh and by the way, here is your dns resolver address and here is your gateway address [15:12] ! [15:12] your phone happily takes in all that info, and then lets you connect to dgplug for you to learn about networking [15:12] next [15:12] Spec_droid, questions? [15:13] i remember on linux or any unix the resolver is built in [15:13] but there are also libs that can do it (usually better) [15:13] ! [15:13] why did they have to build in the resolver? it feels like it should be in the application space [15:14] kiyo, yes, but who can the resolver talk to, if it cannot resolve addresses? :) [15:14] kiyo, those decisions are out of scope for our discussion here XD [15:14] next [15:14] yes sorry enjoying being a student too much today! [15:15] So, at the most basic level, we can say that networking is just ethernet frames doing their thing? [15:15] And there's multiple layers on top of that [15:15] Spec_droid, at the most basic level it is electrons riding in wires or through the air XD [15:16] and then lots of layers on top :) [15:16] but yea. [15:16] XD [15:16] for most practical purposes though, we don’t even need to talk about ethernet frames [15:16] ip packets are what we focus on [15:17] I remember you see them in wireshark [15:17] for e.g. you could sniff ethernet frames too, but most folks packet sniff ip [15:17] not much use as most of the packet is encrypted [15:17] like kiyo just mentioned above [15:17] kiyo, it wasn’t not too long ago :) [15:18] it depends on what the hosts are doing [15:18] but yea we have kinda come to the end of our journey [15:18] we layer more on top for various purposes [15:19] we use http to sling text and images and other stuff around [15:19] and then we realised that people snooped in [15:19] so we layered in ssl (tls) above tcp and then ran http on top of that [15:19] we use ssh to talk to remote machines [15:20] we use ica/rdp/vnc/x to have remote gui sessions [15:20] we use pop/smtp/imap to send structured bits of text we call email [15:20] everything rides on the protocols we learnt about [15:21] now hopefully the tools mentioned in the lessons will give you greater insight into what we learnt about today [15:21] you can do a traceroute to trace routes [15:22] you can ping to check if a remote machine is responding [15:22] you can dig to find meta data about a machine [15:23] and if you have any questions, just put them in here or on the mailing list and i’ll be happy to go search and answer you :) [15:23] i owe you both a bit of an apology for my no shows the past two weeks [15:23] but there was a death in the family and i was dealing with that. [15:23] more questions [15:24] its ok! and my condolences. [15:24] thank you [15:24] Not a big deal, today's session compensates for the past, and so sorry... [15:24] I guess this is the last lesson on lym? [15:24] Spec_droid, have a better picture? [15:24] kiyo, last lesson from the book yes [15:25] jasonbraganza: Yes, thanks :) [15:25] but if you ever have a question that is systems related, or you want to know why something is the way it is with hardware or networks or operationg systems ask away :) [15:25] kiyo, ^ [15:26] I think i'm ok. Can't wait to run traceroute next time my hotel wifi is connected but doesn't work... [15:26] not just now. i meant whenever :) [15:26] specbeck, no questions for now? [15:27] I have a question jason [15:27] shoot [15:27] yes, none for today :) [15:27] i asked a weeks back but do you have some good resources for bpftrace [15:28] i used Dtrace on free bsd in the past bpftrace is the shiny new modern one for linux and you can set probes in the kernel level [15:29] ooh no :) sorry! it’s been a while since i tangled with bpf! but i will be in the coming months. and if i come across something interesting, i’ll tell you [15:29] you can see the frames going in and out and probe say the unix send() or recv() apis. [15:29] or knowing how my life is, you will tell me first :) [15:29] let’s call it a night then! thank you folks :) ----END CLASS----