<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xinu.cs.mu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jcowdy</id>
	<title>Embedded Xinu - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://xinu.cs.mu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jcowdy"/>
	<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php/Special:Contributions/Jcowdy"/>
	<updated>2026-06-15T14:36:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3899</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3899"/>
		<updated>2011-06-22T15:48:58Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
= Design = &lt;br /&gt;
The new network stack design does not have a NET device. The read and write device function paradigm does not map well to the network stack. TCP, UDP, and RAW sockets do not read from a network device, rather a network receive thread calls a chain of receive functions to process the packet at each layer in the network stack. A write function does not work well for sending a packet since the final destination of the packet is not known until the IP and/or ARP layers. The write device function assumes the thread calling write knows exactly which device to which the data should be written. A table of netif structures (separate from devtab, the table of devices) is still maintained to store configuration and accounting information for each underlying device (ETH, etc.) with which the network stack is receiving and sending packets.&lt;br /&gt;
&lt;br /&gt;
A network interface is setup using the netUp command. An underlying device, IP address, mask, and gateway must be provided when calling netUp. DHCP functions as a separate process which runs before and netUp is called; DHCP interacts directly with the underlying device (ETH, etc.) without using the network stack.&lt;br /&gt;
&lt;br /&gt;
Network receive threads continually read incoming packets from an underlying device. Each network interface has one or more network receive threads running. The netRecv function includes an infinite loop which reads a packet from the underlying device and calls ipRecv or arpRecv depending on the type of the packet. The packet is read into a buffer declared as a local variable within the netRecv function. At the IP layer ipRecv calls tcpRecv, udpRecv, rawRecv, or passes the packet to a routing thread. No sending of packets should ever occur under a network receive thread. For protocols in which an incoming packet may generate the need to send a reply packet, the protocol must have a separate thread for sending. For example, if an incoming TCP packet contains data which needs to be acknowledge, and tcpRecv should set a flag or send a message to a TCP monitor thread which will proceed to send the acknowledgement.&lt;br /&gt;
&lt;br /&gt;
A global buffer pool is allocated for storing outgoing packets. One pool exists for use by all network interfaces. When sending a packet, the sending function (ex. tcpSend) obtains a buffer from the pool, calls the appropriate lower-level send function (ex. ipSend), and, after the function returns, returns the buffer to the pool.&lt;br /&gt;
&lt;br /&gt;
The network stack is designed to treat the Xinu backend as both a router and a multi-homed host. Packets received on any of a backend's network interfaces may be destined for the backend or may need to be routed to another network destination. The network layer (IP layer) determines how to handle incoming packets. In the function ipRecv, the destination of an IP packet is compared against the IP address and broadcast address for every active network interface. If the destination address of the IP packet matches the IP address of the interface on which it was received or the IP address of any other network interface, the packet is passed to the appropriate transport layer receive function (udpRecv, tcpRecv, etc.). IP packets whose destination does not match with one of the active network interfaces are passed to the routing module of the network stack, i.e. the function rteRecv is called. In rteRecv the packet is copied into a buffer from the global buffer pool and placed on a queue for a routing thread to process. Currently, the network stack does not use a selective drop algorithm when the router is overloaded; once the queue of packets to route is full, all subsequent packets which require routing are dropped. A routing thread processes each packet on the routing queue. If no route is known, the packet is dropped; otherwise the TTL is decrement, the checksum is recalculated and the netSend function is called. Packets being sent from the transport layer (udpSend, tcpSend, etc) are not passed to the routing thread. The transport layer calls ipSend which performs a route table lookup, sets up the IP packet header and calls netSend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Quotes&amp;diff=3865</id>
		<title>Quotes</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Quotes&amp;diff=3865"/>
		<updated>2011-06-20T20:05:09Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summer 2011 ==&lt;br /&gt;
* AM: &amp;quot;We'll see how much I get done today. I'm easing myself into summer research mode, OK? I showed up. That's a start.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;We need to get a third one on our little braniac team that's good at focusing on things.  Then we could get some really cool stuff done.&amp;quot;&lt;br /&gt;
* KS: [referring to car battery in lab] &amp;quot;So... you trying to run Xinu on this thing?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;You know what's weird? Some people were born after 1990.&amp;quot; / MZ: &amp;quot;Annie's little brothers were born after 1990.&amp;quot; / AM: &amp;quot;My girlfriend was born after 1990.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;1992.&amp;quot;&lt;br /&gt;
* PS: &amp;quot;You mean you don't like watching me watching you sleep.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Dump her.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;What if the rebooter starts on fire?&amp;quot; / MB: &amp;quot;I guess that would cause it to fail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Spring 2011 ==&lt;br /&gt;
* AM: &amp;quot;I don't have a week; I have like five plus two days.&amp;quot;&lt;br /&gt;
* OS Kid: &amp;quot;Wow, my whole program is a 'while' loop.&amp;quot; / KP: &amp;quot;Welcome to embedded systems.&amp;quot;&lt;br /&gt;
* KP: [referring to oscope signal] &amp;quot;Well, the basic concept is there.&amp;quot; / AM: &amp;quot;Yeah, maybe if you want to make a human to demon translator.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;I'm not going to go as far to say it's killing two birds with one stone.  It's more like you throw a handful of stones and take out a whole field of birds.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I'm really sick. I have the super flu or something.&amp;quot; / SG: &amp;quot;Super Flu? ... Sounds like a movie Dr. Brylow would own.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;married.c:1:20: error: social.h: No such file or directory&amp;quot;&lt;br /&gt;
* MZ: &amp;quot;I actually wrote vim back in the 60's.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;You're the worst computational sciences major ever. You hate computers and you hate numbers.&amp;quot; / AM: &amp;quot;Right. Research is like a battle between me and this machine. I try to make it surrender information. Epic struggle between good and evil.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;So you see the limitations of Google because you're looking for an answer to a very specific question in a domain that is not widely searched.&amp;quot; / SG: &amp;quot;Yahoo then?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Psychology and sociology are just the study of how irrational girls think that don't understand logic.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Leave your gun and knife collection at home... even though we ''are'' going to Texas.&amp;quot;&lt;br /&gt;
* MZ: [pouring liquid coffee into trash] &amp;quot;There's got to be something absorbant in there.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;So look at this...this is probably what's been going wrong for months. Whoaaah, but why???&amp;quot;&lt;br /&gt;
* AM: &amp;quot;If you take all those words I just said and add or subtract a couple it's right.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;It's the most fun I have ever had by myself.&amp;quot;&lt;br /&gt;
* SG: &amp;quot;I'm getting turned on even and I hate Pokemon!&amp;quot;&lt;br /&gt;
* AW: &amp;quot;This place is infested with Adams.&amp;quot;&lt;br /&gt;
* KP: [playing Angry Birds] PHYYYYYSSSSSICSSS!&lt;br /&gt;
&lt;br /&gt;
== Fall 2010 ==&lt;br /&gt;
&lt;br /&gt;
* DB: &amp;quot;Adam is 'theoretically' good at what he does&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Do you realize that if a girl has a boyfriend you're competing with just one man, but when she's single you're competing with every man?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I'm trying to quit caffeine.  I think I had a heart attack this morning.&amp;quot;&lt;br /&gt;
* MS: [in regards to running Xinu on a roomba] &amp;quot;I believe the O/S students would say, 'Xinu doesn't need to suck any more than it already does.'&amp;quot;&lt;br /&gt;
* KP: &amp;quot;If there's a ghetto solution to something, it's in this lab.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Iced tea is too iced tea-y, and lemonade is too lemonade-y&amp;quot;&lt;br /&gt;
* [Dr. Brylow enters the lab] MK: &amp;quot;Dibs!&amp;quot; / SG: &amp;quot;Dibs!&amp;quot; / RB: &amp;quot;You can't dibs Dr. Brylow, he's a people.&amp;quot;&lt;br /&gt;
* KP: [In reference to the thermostat] &amp;quot;Stand back; I'm about to engineer this thing.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Type make, and it compiles... with errors, because it's _____'s code.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;You can't just type like string something in C?&amp;quot; / KP: &amp;quot;No.&amp;quot; / AM: &amp;quot;God, who the hell uses C anyway?&amp;quot; / KP: &amp;quot;Uh... everyone in this laboratory?&amp;quot;&lt;br /&gt;
* KP: &amp;quot;Hmm. Should I call DPS and make them let me into my office?&amp;quot; / VB: &amp;quot;Start a fire! That will make them come over here.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;How come CTRL+A doesn't select everything? [on Nekros] ... Oh wait, I'm using the keyboard on my laptop.&amp;quot;&lt;br /&gt;
* SG: &amp;quot;Why are you treating me like a hooker?&amp;quot; ... &amp;quot;Whooo all these singles, strip club tonight boys!&amp;quot;&lt;br /&gt;
* AG: [referring to the new lockers] &amp;quot;They're probably the most secure thing on the Windows side of the lab.&amp;quot;&lt;br /&gt;
* [when KP's scp failed] Ashley: Mawdryn and Nyssa are out shopping. Nekros is there too.&lt;br /&gt;
* DB: &amp;quot;This entire sentence reads like it was outsourced to India.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Steve makes my heart skip a beat.&amp;quot; / VB: &amp;quot;I feel the same way.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Drinking by yourself is way more fun than drinking with other people. ... I don't get a lot of alone time.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Victor plays dancing video games all the time; that doesn't necessarily mean he knows how to dance.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;No, he'll probably just wait around in his person... drawn... carriage...&amp;quot; / AM: &amp;quot;You mean a rickshaw?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Ahhhhh, stupid quotes page! I haven't been working for like ten minutes.&amp;quot;&lt;br /&gt;
* RB: &amp;quot;I don't know if I really want to let girls play with my gun.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I love LaTeX; it's like a mystery. Every time you compile, you never know what you're going to get.&amp;quot;&lt;br /&gt;
* SG: [to the tune by Cutting Crew] &amp;quot;I ... just compiled in your arms tonight. Must have been somethin' you typed.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;My numbers are a little off...&amp;quot; / AM: &amp;quot;Just blame it on numeric instability and move on.&amp;quot;&lt;br /&gt;
* MZ: &amp;quot;I can't believe we didn't notice that k*sin(x) before. Where do you get your springs Yaz? Does McMaster have like a weird section?&amp;quot;&lt;br /&gt;
* KP: &amp;quot;I'm going to have to side with PartyAdam on this one.&amp;quot; / AM: &amp;quot;And you know how much it pains him to say that so it must be true.&amp;quot;&lt;br /&gt;
* AM: [in reference to an argument that spurred about whether quotes should go at the top or the bottom of each section] &amp;quot;I'm going to have to agree with RA Kyle on this one.&amp;quot; / KP: &amp;quot;And you know how much it pains him to say that so it must be true.&amp;quot;&lt;br /&gt;
* SG: &amp;quot;Tron in 3D would be better than a trip to Disney World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Summer 2010 ==&lt;br /&gt;
&lt;br /&gt;
* AM: &amp;quot;It's more confusing when I get it!&amp;quot;&lt;br /&gt;
* DB: [In reference to WRT160NL routers] &amp;quot;This isn't like the other children. It's something different.&amp;quot;&lt;br /&gt;
* Krenz: &amp;quot;There's light at the end of the tunnel and it's not a train.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;I'm so confused by this new ls.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Do I need to sacrifice goat entrails to the new Fedora 13 for you to be happy with it?&amp;quot;&lt;br /&gt;
* AG: &amp;quot;Does anyone here know Perl.&amp;quot; / DB: &amp;quot;It is an abomination.&amp;quot;&lt;br /&gt;
* AK: [Commit message] &amp;quot;fixed first bug after the last bug&amp;quot;&lt;br /&gt;
&amp;lt;!-- * AK: &amp;quot;killall batch grading... killall xterm... &amp;quot; / DB: &amp;quot;killall students...&amp;quot; --&amp;gt;&lt;br /&gt;
* DB: &amp;quot;Just add like three more zeros to it. Screw it.  ... Okay maybe three zeros was a little much.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;Why can't the phone work like this.&amp;quot; / DB: &amp;quot;Because the phone is not a stepper motor.&amp;quot; / KP: &amp;quot;Can I write a thesis on M&amp;amp;M dispensing?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Can we just set it back to Fedora 1 and leave it there?&amp;quot;&lt;br /&gt;
* KP: &amp;quot;How long could it take to write an essay for your diet coke of a thesis?&amp;quot;&lt;br /&gt;
* SG: &amp;quot;I can't believe I ran into a f*cking pole.&amp;quot;&lt;br /&gt;
* SG: &amp;quot;I expected more blinking and less doing nothing.&amp;quot;&lt;br /&gt;
* KP: &amp;quot;Have you ever had Pita Bros?&amp;quot; / DB: &amp;quot;No, where's that?&amp;quot; / KP: &amp;quot;It's the hybrid electric cart that parks by campus selling food.&amp;quot; / DB: &amp;quot;Oh, no don't eat there that's a good way to get botulism.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Who castrated the ARP command?&amp;quot;&lt;br /&gt;
* DB: &amp;quot;If the Ethernet device is a fire hose and the serial device is a garden hose, where should the excess water go?&amp;quot; / KP: &amp;quot;The pool.&amp;quot;&lt;br /&gt;
* KT: &amp;quot;We need to break a router so we have a reason to use the debricker.&amp;quot; / KP: &amp;quot;There's a whole pile of reasons right over there.&amp;quot;&lt;br /&gt;
* KP: [shakes head] / KT: &amp;quot;Have I failed in some way?&amp;quot;&lt;br /&gt;
* KP: &amp;quot;Let's boot this b*tch!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Spring 2010 ==&lt;br /&gt;
&lt;br /&gt;
* AM: &amp;quot;Babies are like larvae that evolve into people.&amp;quot;&lt;br /&gt;
* KT: &amp;quot;I use tilde all the time.&amp;quot; / DB: &amp;quot;Maybe a little too much.&amp;quot;&lt;br /&gt;
* KT: [after using a configure script that accidentally made a directory named ~] &amp;quot;I was trying to remove the ~ directory. I tried ''rm -r ~'' and the system complained about files in use. I thought that was weird, so I used the ''-f'' force option [resulting in ''rm -rf ~'']. When I tried to use ''make'', it said file not found and that is when I realized I deleted my home directory.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;What does that mean?&amp;quot; / MS: &amp;quot;You can't eat Catholics on Friday.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;These little details are like sorting your M&amp;amp;Ms by color before you eat them.&amp;quot; / ZL [who is color deficient]: &amp;quot;I always do that. It's good practice.&amp;quot; / DB: &amp;quot;Bad example.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Fall 2009 ==&lt;br /&gt;
&lt;br /&gt;
* AK: &amp;quot;If you fail [the GRE] every time, that's a hint.&amp;quot;&lt;br /&gt;
* ZL: [Talking about the sound coming from the VoIP speakers] &amp;quot;That's a new one. I like it. You could almost dance to it.&amp;quot; / AK: &amp;quot;Really quickly.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;Do you live here [in the lab]?&amp;quot; / DS: &amp;quot;If that isn't the pot calling the kettle black...&amp;quot; / ZL: &amp;quot;You make a good point.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;When does grad school get fun?&amp;quot; / DB: &amp;quot;When you are done, and you look back on it fondly, and you have a high paying doctoral job.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;It's Friday. Who am I kidding?&amp;quot;&lt;br /&gt;
* MK: &amp;quot;I'm going to be using this [red pen] all semester. It will be a good investment.&amp;quot;&lt;br /&gt;
* FH: &amp;quot;Not that it's my thing, but there is no alcohol allowed, right?&amp;quot;&lt;br /&gt;
* DB: [After setting a bag of candy on the table] &amp;quot;Marquette Dental School appreciates your business.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Thesis first!&amp;quot;&lt;br /&gt;
* Steve Merrill: [While working with MATLAB] &amp;quot;FAIL!&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;...or we could throw it off the balcony.&amp;quot; / DB: &amp;quot;NO!&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;I have a plan to test that. It requires three computers.&amp;quot; / DB: &amp;quot;I like it already.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Summer 2009 ==&lt;br /&gt;
&lt;br /&gt;
* DB: &amp;quot;Why is this not working?&amp;quot; / MS: &amp;quot;Morbius is not promiscuous enough.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Isn't holy water hard to come by?&amp;quot;&lt;br /&gt;
* DB: [Speaking about AM's meeting with CS] &amp;quot;We also don't recognize [Struble] as a valid commitment.&amp;quot;&lt;br /&gt;
* RB: &amp;quot;Don't just sit there and gloat at me.&amp;quot;&lt;br /&gt;
* RB: &amp;quot;Jokes don't really work right now.  Sorry.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Ruining my body with one substance is enough.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I need someone to hold my hand when I go get a haircut.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Everyone sounds lame when they post on girls' walls.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I'm in Cudahy. I work here and live here.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Adam counts as -1.&amp;quot; / AG: &amp;quot;Only one?&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;It sounds like crap but it corresponds.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;I will be the supportive advisor this evening.&amp;quot; / MS: [Sarcastically] &amp;quot;What a change.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;In dangerous situations, that's when it's best to drink&lt;br /&gt;
* AG: &amp;quot;Yeah.  We played Wii bowling. And I learned how to play Magic.&amp;quot; / DB: &amp;quot;Ohh noo. It's like supervoc being taking over by the mad man.  Once SV7 is gone its all downhill.&amp;quot;&lt;br /&gt;
* DM: &amp;quot;Iran. Iraq. IRAW.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;You can only flash something once.&amp;quot; / ZL: &amp;quot;Clearly, because you get arrested after that.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I was rushing because I needed to be here by 3pm today.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;He just put a hack on top of a hack on top of a hack.&amp;quot; / AG: &amp;quot;You don't have a network stack, you have a network hack.&amp;quot; / ZL: &amp;quot;You have a network pile.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Someone wrote on our table.&amp;quot; / Anonymous: &amp;quot;Kill them.&amp;quot;&lt;br /&gt;
* DB: [Talking about hair] &amp;quot;That's not a matter of personal preference; that's correct.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;There would be so many good quotes if we allowed f-words.&amp;quot;&lt;br /&gt;
* MS: [Speaking to DB's friends] &amp;quot;You might want to bring your own videos.&amp;quot;&lt;br /&gt;
* RB: &amp;quot;Oh no.  It works consistently.  It gets my hopes up only to shatter them.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;It's good. But..&amp;quot; / AG: &amp;quot;But, It looks like I cheated. ... You got to cheat sometimes.&amp;quot;&lt;br /&gt;
* DH: &amp;quot;Why would I doubt you, you are a student whose life depends on following the rules, I am only Director of a program which is supposed to enforce the rules.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Yeah. I'm pretty much done. I'm wasted.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;I fear ugliness.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Chicks dig werewolves.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Computers should never take this long to do something unless its awesome.&amp;quot; / GV: &amp;quot;Did you press the turbo button?&amp;quot;&lt;br /&gt;
* RB: [To AM] &amp;quot;You're going to make some freaky girl very happy someday.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;It looked like you were conducting an orchestra.&amp;quot; / MS: &amp;quot;Well, I was composing an email.&amp;quot;&lt;br /&gt;
* RB: &amp;quot;I feel like I am using beta every time I log into Windows.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;Get it done.  Testing is not important.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;What's wrong with you people?&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;The thing is, when I do say something offensive, it's very good.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;The sooner I get kicked out of the lab, the sooner I can start drinking.&amp;quot;&lt;br /&gt;
* MS: [Commit message] &amp;quot;Updated the Xinu banner for version 2.0. We can release now.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Spring 2009 ==&lt;br /&gt;
&lt;br /&gt;
* AM: &amp;quot;Do you really want me in charge of something that affects another human being?&amp;quot;&lt;br /&gt;
* TB: &amp;quot;Sleep sounds amazing right now.&amp;quot; / AM: &amp;quot;Oh my god...does it ever!&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;I'm all about making fun of people while they're in the room.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;The Internet is a vast wasteland of sewage.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;I won't say it's fixed, but I have now intervened on your behalf.&amp;quot;&lt;br /&gt;
* Zachary's Girlfriend: &amp;quot;Darn. I am taking on Brylow traits.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;You can think of them as ornaments hung on a syntax tree.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;purged Tim from nvram&amp;quot;&lt;br /&gt;
* AK: &amp;quot;If you want some sort of base for how sick I still feel just insert a burst of coughing after each sentence while reading this email.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;The rat gets nothing!&amp;quot;&lt;br /&gt;
* AG: &amp;quot;My brain operates at 10,000 Gemberflops per second.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;I'm not saying it's my opinion.  I'm just saying its Adolph's opinion.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;He's celebrating the month of feasting.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;There's a special travel dispensation for pretzels.&amp;quot;&lt;br /&gt;
* CS: &amp;quot;I'm not very quotable.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Oh, it's travelling up in my butt.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;I shut off Slayer while we are gone.&amp;quot; / MS: &amp;quot;I'm sure Mawdryn will turn itself off, too.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;My room mate never plays with me.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;I just made a mess on the seat.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;I don't need a haircut - I am representing myself at this conference.&amp;quot;&lt;br /&gt;
* AM: [Referring to high performance gum] &amp;quot;It is just like high performance computing: it's really really good for a really really short period of time.&amp;quot;&lt;br /&gt;
* AK: [Speaking to Brylow]  &amp;quot;We just got out of Cracker Barrel and you are already eating pretzels.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Oh my God - Dinosaur World.  We are skipping SIGCSE.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;Yeah, my life is a joke sometimes.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;One of these days I'll get English right.&amp;quot;&lt;br /&gt;
* Presenter at SIGCSE 2009: &amp;quot;I mean, it's kind of fun to trash your operating system.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;I like to let my hair air-dry. It poofs better.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;I would not want Tim on my team for a game of telephone.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;They're not pretzel rods, they're fuel rods.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;But that's non-linear board usage.  I never do that.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;There's a lot more TODOs where those came from.&amp;quot;&lt;br /&gt;
* DB: [Said to an almost empty lab] &amp;quot;Aren't I paying a bunch of students to work for me?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Aww we all got laser pointers!  This is gonna rule!&amp;quot;&lt;br /&gt;
* TB: &amp;quot;I thought I fixed everything doing nothing. It happens so many times.&amp;quot;&lt;br /&gt;
* [A discussion on going to the bar in a lab of all guys] / AG: &amp;quot;We're probably not as good looking as Victoria.&amp;quot; / AM: &amp;quot;Yeah, and she has a boyfriend...but none of you have boyfriends.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Just for funsies.&amp;quot;&lt;br /&gt;
* TB: [As AM points a laser pointer at TB] &amp;quot;I feel like I'm being sniped.&amp;quot;&lt;br /&gt;
* Ryan Feil: [Speaking in the lab of an operating systems assignment] &amp;quot;Shouldn't there be more people here scrambling to get this done.&amp;quot;&lt;br /&gt;
* MS: [As DB writes &amp;quot;IP Stack&amp;quot; on the board] &amp;quot;Ha ha. He pees stack. IP urine.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;Really all we have right now are questions.&amp;quot;&lt;br /&gt;
* MS: [On a sheet of paper hidden among AM's homework] &amp;quot;#6. Thm: Adam sucks! Ha ha. / Pf: trivial.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;I should just source control my...everything.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;English is not sufficient for teaching compilers.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;That's it. It's 100 percent done.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;We were 100 percent done. We just need to get more speed-up.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;So, Tim, when you are 30, will you say your life is 100 percent done?&amp;quot;&lt;br /&gt;
* AG: &amp;quot;make tim: now compiling nonsense.c&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Oh, here we go: proof by rant.  That's a new one.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Do you really want me representing this school.&amp;quot; / DB: [Out of context] &amp;quot;No.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;If I leave the lab, I feel like I'm leaving civilization behind.&amp;quot;&lt;br /&gt;
* AG: [Browsing through Mike's wedding gift registry] &amp;quot;Xinu only has 50 threads.  The sheets Mike wants have 410, but they don't have memory protection.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Oh good Brylow left.  Now I can leave.&amp;quot;&lt;br /&gt;
* AK: [First commit message] &amp;quot;modified some ifthenelse stuff to look a little more like class&amp;quot; / [Second commit message] &amp;quot;removed the code I added to ifthenelse, it made no sense and didn't compile&amp;quot;&lt;br /&gt;
* DB: [To a prospective student touring the System's Lab] &amp;quot;Ignore the rat.&amp;quot;&lt;br /&gt;
* MS: [Discussing DB's tests] &amp;quot;Why would you study for his test? You are either screwed or not screwed...it's fairly binary.&amp;quot;&lt;br /&gt;
* MS: [Left a message for AG] &amp;quot;I hax0rd your boxor!&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Oh look.  She dumped me on Facebook.  Awesome!&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Don't stroke the yeast colony.&amp;quot;&lt;br /&gt;
* MS: [Speaking of his yeast colony] &amp;quot;It's free!&amp;quot; / DB: &amp;quot;Don't release it!&amp;quot;&lt;br /&gt;
* MS: &amp;quot;If I just get really offensive and harsh with what I say then I won't get quoted any more.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Alright, I'm going home.  See you in the morning.&amp;quot; / ZL: &amp;quot;The morning.  Really?&amp;quot; / DB: &amp;quot;Well no.&amp;quot;&lt;br /&gt;
* MS: [Anticipating DB's response to new advisees] &amp;quot;You want to be my advisee.  Kiss the clock.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;It is much more important to see me being reamed up the ass.&amp;quot;&lt;br /&gt;
* JA: [Discussing potential names of Dan Mahoney's future son] &amp;quot;Name him your last name backwards so he can be a palindrome.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Big setup no follow through.&amp;quot; / AG: &amp;quot;I'm all about that.&amp;quot; / MS: &amp;quot;That's what she said.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;That's not an algorithm; that's a sweatshop.&amp;quot;&lt;br /&gt;
* Lyndsie: &amp;quot;High school cheer leading is even on ESPN.&amp;quot; / MS: &amp;quot;That is really sweet!&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I always assume that everyone in the world is just listening to me to talk. I also assume that people just follow me around just to listen to me.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Every time Tim opens his mouth to say something about the poster, you just close your eyes and pray.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;This will all work out right? Induction through hand-waving.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Except it's like fake adoption, where it turns out the child is actually yours.&amp;quot;&lt;br /&gt;
* &amp;quot;If you're concerned about that you're probably in the wrong major, because we're going to build skynet.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;So we are selling you to indentured servitude now?&amp;quot; / AM: &amp;quot;I hope so, then I get free passage to the new world.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Why do you work here?&amp;quot;&lt;br /&gt;
* AM: &amp;quot;I have three desks worth of space just taken up with garbage and shit.&amp;quot;&lt;br /&gt;
* Anonymous: &amp;quot;You know, pretty soon that relationship will be 100% done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Fall 2008 ==&lt;br /&gt;
&lt;br /&gt;
* MN: [Talking about the large rubber rat] &amp;quot;I don't get paid enough to have this thing look at me.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Now that grading's done, I deserve a pretzel.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;I haven't even started, and I already feel defeated.&amp;quot; / MS: &amp;quot;Welcome to graduate school.&amp;quot;&lt;br /&gt;
* ''RFC 793: Transmission Control Protocol'': &amp;quot;When the original SYN (pun intended) finally arrives at line 6, the synchronization proceeds normally.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;If I think more than 30 seconds into my own future I start to panic.&amp;quot;&lt;br /&gt;
* AM: &amp;quot;Once again, I've solved the problem, but the computer has failed to see my genius.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;It takes many years of sucky teaching to learn how to teach well.  You have to start sucking somewhere.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;When you get the packet it is all going to be out of order.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;I was going to ask you what they stood for, but I knew the answer was: 'Get the hell out of my office Mike.'&amp;quot;&lt;br /&gt;
* DB: &amp;quot;You have the plague now too?&amp;quot;&lt;br /&gt;
* AK: &amp;quot;It was like Tim's brain on a piece of paper.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;His abstract was words in a paint can and all he did was throw it on a poster.&amp;quot;&lt;br /&gt;
* TB: &amp;quot;Yeah, how did we get sidetracked.&amp;quot; / AM: &amp;quot;I started talking.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Now US-41 through Terre Haute, that's the corridor of hell.&amp;quot;&lt;br /&gt;
* Zachary's Sister: [Upon visiting the Systems Lab] &amp;quot;It's like having six zacs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Summer 2008 ==&lt;br /&gt;
* linux-2.6.25.9/lib/iomap.c: Ugly macros are a way of life.&lt;br /&gt;
* ../net/tcp/tcpTimer.c:101: error: ‘rum’ undeclared (first use in this function)&lt;br /&gt;
* BH: &amp;quot;Vim has a learning curve.&amp;quot; / MS: &amp;quot;No, it's a line.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;[re: Firefox Plushie] Wow, that look more like a raccoon to me.  And wouldn't that just make people position Linux Tux and Firefox Fux is various explicit positions?   Or is that just me?&amp;quot; / DB: &amp;quot;Yes, Michael.  It is just you.  And I don't think the Firefox mascot's proper name is 'Fux.'&amp;quot;&lt;br /&gt;
* JP: &amp;quot;I'm laughing because my nose itches.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;I'm not going to start my own business. For a business to work, the owner has to care.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;''Broken Beyond Syntax'', that's going to be the title of my autobiography.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Spring 2008 ==&lt;br /&gt;
* AK: &amp;quot;[online review of sushi place in Portland with Aaron] Sit in the lounge. The red chairs are very comfortable. The food was really good too. Had some chicken dish, don't remember what it was called.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;I'm not saying it's my opinion, I'm just saying it's an opinion.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;Yeah, that's just fool complicated.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;Even Tim's pictures have bugs in them.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;Warnings mean you are smarter than the compiler!&amp;quot;&lt;br /&gt;
* AG: &amp;quot;Do you use text messaging?&amp;quot; / JP: &amp;quot;What's that?&amp;quot;&lt;br /&gt;
* AG: &amp;quot;I feel like doing something.  What should I do?&amp;quot; / PH: &amp;quot;Go home.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Any questions?  What else have I forgotten to tell you?&amp;quot; (email to lab) / Response: &amp;quot;The XINU lab notes that you forgot to tell us that you love us.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Traditionally, graduate students get a bed to themselves in this situation.&amp;quot;&lt;br /&gt;
* PH: &amp;quot;I'm really going to enjoy watching the commits to this branch.&amp;quot;&lt;br /&gt;
* ZL: &amp;quot;Voc and Supervoc joined at the UART&amp;quot;&lt;br /&gt;
* George Corliss: &amp;quot;Verbose.  Minus 5.&amp;quot;&lt;br /&gt;
* Steve Merrill: &amp;quot;Publish!  Publish!  Publish!&amp;quot; (walking down the hall past junior faculty offices)&lt;br /&gt;
* JP: &amp;quot;I am just participating cause I'm standing here.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;New commands are silly.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;I've solved all kinds of problems in my life that no one's ever solved before.&amp;quot;&lt;br /&gt;
* AG: &amp;quot;You know scheme.  I know scheme.  We all scheme for ice cream.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;I like StarTrek, but that would be less a hobby and more an investment.&amp;quot;&lt;br /&gt;
* MS: &amp;quot;Subtract two.&amp;quot; / MN: &amp;quot;Why?&amp;quot; / MS: &amp;quot;...because I said so.&amp;quot; / MN: &amp;quot;...alright...&amp;quot; / MS: &amp;quot;...and then when that doesn't work subtract four.  But two should work.&amp;quot; / MN: &amp;quot;Two didn't work.&amp;quot; / MS: &amp;quot;Damnit!  Subtract four.&amp;quot; (Conversation continues in a similar fashion until Matt ends up subtracting eight.)&lt;br /&gt;
* DB: &amp;quot;So they basically made a hammer and went after everything that could be a nail.&amp;quot;&lt;br /&gt;
* JP: &amp;quot;This is so unfair to us petty criminals.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;We'll all be getting eye transplants soon.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;''I'' am somehow derived from C.&amp;quot; (on the ubiquity of the C programming language)&lt;br /&gt;
* JP: &amp;quot;First you have to get the $3,000 license for the whizbang that does all the work.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;I don't remember what the silly window is, but it must be important.&amp;quot;&lt;br /&gt;
* AK: &amp;quot;[UML is] just a bunch of boxes on paper.&amp;quot;&lt;br /&gt;
* DB: &amp;quot;Java has corrupted you all.&amp;quot;&lt;br /&gt;
* KJ: &amp;quot;There are some fonts that ''really'' spread out a paper.&amp;quot; (discussing parameters for COSC 198 term paper)&lt;br /&gt;
* DB: &amp;quot;You're telling me to put in less work.  I'm not going to argue with you.&amp;quot;&lt;br /&gt;
* ''See MIPS Run, 2nd Ed.'': &amp;quot;When we finally make contact with aliens, their wheelbarrows will have round wheels and their computers will probably use fixed-size pages.&amp;quot;&lt;br /&gt;
* ''RFC 826: An Ethernet Address Resolution Protocol'': &amp;quot;The world is a jungle in general, and the networking game contributes many animals.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== XINU Pith ==&lt;br /&gt;
* XINU Cometh.&lt;br /&gt;
* XINU Returneth.&lt;br /&gt;
* XINU Calls.&lt;br /&gt;
* XINU Returns.&lt;br /&gt;
* XINU Creates.&lt;br /&gt;
* XINU Reschedules.&lt;br /&gt;
* XINU Saves and Restores.&lt;br /&gt;
* XINU Preempts.&lt;br /&gt;
* XINU Comes Not to JUDGE, But to EXECUTE...&lt;br /&gt;
* XINU Knows Your Inmost Firmware.&lt;br /&gt;
* XINU Brings New Life to Old Hardware.&lt;br /&gt;
* XINU Waits.&lt;br /&gt;
* XINU Allocates.&lt;br /&gt;
* XINU Deallocates Away.&lt;br /&gt;
* XINU Tastes Great.&lt;br /&gt;
* XINU Has Less Filling.&lt;br /&gt;
* XINU Runs FOREVER.&lt;br /&gt;
* XINU Eschews Obfuscation.&lt;br /&gt;
* XINU Does Not Do Windows.&lt;br /&gt;
* XINU Brings ORDER out of CHAOS.&lt;br /&gt;
* XINU Brings CHAOS from ORDER.&lt;br /&gt;
* He Whoever Believes in XINU Shall Have Eternal Processing.&lt;br /&gt;
* XINU Shall Run Again.&lt;br /&gt;
* XINU Is Not UNIX.&lt;br /&gt;
* XINU.  It's What's For Dinner.&lt;br /&gt;
* No XINU and No Mips Make Homer Something Something...&lt;br /&gt;
* See XINU.  See XINU Run.  Run XINU Run.&lt;br /&gt;
* XINU Allocateth, XINU Deallocateth Away.&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
{| &lt;br /&gt;
|-&lt;br /&gt;
|'''Abbreviation''' &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; || '''Name'''&lt;br /&gt;
|-&lt;br /&gt;
| AG || Aaron Gember&lt;br /&gt;
|-&lt;br /&gt;
| AK || Adam Koehler&lt;br /&gt;
|-&lt;br /&gt;
| AM || Adam Mallen&lt;br /&gt;
|-&lt;br /&gt;
| AW || Adam Welc&lt;br /&gt;
|-&lt;br /&gt;
| BH || Brandon Hahn&lt;br /&gt;
|-&lt;br /&gt;
| CS || Craig Struble&lt;br /&gt;
|-&lt;br /&gt;
| DB || Dennis (or Dr.) Brylow&lt;br /&gt;
|-&lt;br /&gt;
| DH || Doug Harris&lt;br /&gt;
|-&lt;br /&gt;
| DM || Dan Mahoney&lt;br /&gt;
|-&lt;br /&gt;
| DS || Devin Sigulinsky&lt;br /&gt;
|-&lt;br /&gt;
| FH || Fran Hurtado&lt;br /&gt;
|-&lt;br /&gt;
| GV || Gabe Van Eyck&lt;br /&gt;
|-&lt;br /&gt;
| JP || Justin Picotte&lt;br /&gt;
|-&lt;br /&gt;
| JA || Joe Pintozzi&lt;br /&gt;
|-&lt;br /&gt;
| KJ || Kyle Jackson&lt;br /&gt;
|-&lt;br /&gt;
| KP || Kyle Persohn&lt;br /&gt;
|-&lt;br /&gt;
| KS || Karl Stamm&lt;br /&gt;
|-&lt;br /&gt;
| KT || Kyle Thurow&lt;br /&gt;
|-&lt;br /&gt;
| MK || Matthias Kohler&lt;br /&gt;
|-&lt;br /&gt;
| MN || Matt Netkow&lt;br /&gt;
|-&lt;br /&gt;
| MS || Michael Schultz&lt;br /&gt;
|-&lt;br /&gt;
| MZ || Michael Ziwisky&lt;br /&gt;
|-&lt;br /&gt;
| PH || Paul Hinze&lt;br /&gt;
|-&lt;br /&gt;
| PS || Paul Spillane&lt;br /&gt;
|-&lt;br /&gt;
| SG || Steven Gago&lt;br /&gt;
|-&lt;br /&gt;
| TB || Tim Blattner&lt;br /&gt;
|-&lt;br /&gt;
| VB || Victor Blas&lt;br /&gt;
|-&lt;br /&gt;
| ZL || Zachary Lund&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Routing&amp;diff=3859</id>
		<title>Routing</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Routing&amp;diff=3859"/>
		<updated>2011-06-17T18:47:11Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The routing daemon is automatically started with XINU.&lt;br /&gt;
&lt;br /&gt;
== Add a Route ==&lt;br /&gt;
To add a route to the route entry table use route add with the following parameters:&lt;br /&gt;
 route add &amp;lt;destination&amp;gt; &amp;lt;gateway&amp;gt; &amp;lt;mask&amp;gt; &amp;lt;interface&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 route add 192.168.6.0 192.168.1.100 255.255.255.0 ETH0&lt;br /&gt;
&lt;br /&gt;
== Delete a Route ==&lt;br /&gt;
To delete a route from the route entry table, use route del with the destination as the third parameter.&lt;br /&gt;
 route del &amp;lt;destination&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 route del 192.168.6.0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
To enable UDP debugging, uncomment the following line in include/route.h&lt;br /&gt;
 //#define TRACE_RT     TTY1&lt;br /&gt;
&lt;br /&gt;
In order to see the trace results you open another console to the second serial port using the router name followed by the number 2.&lt;br /&gt;
 mips-console router2&lt;br /&gt;
Alternatively TTY1 can be changed to TTY0 resulting in the trace printing on the main console.&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3858</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3858"/>
		<updated>2011-06-17T18:46:41Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3857</id>
		<title>TCP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3857"/>
		<updated>2011-06-17T18:46:22Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Examples ==&lt;br /&gt;
[[TCP Echo Test]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
To enable TCP debugging, uncomment the following line in include/tcp.h&lt;br /&gt;
 //#define TRACE_TCP     TTY1&lt;br /&gt;
&lt;br /&gt;
In order to see the trace results you open another console to the second serial port using the router name followed by the number 2.&lt;br /&gt;
 mips-console router2&lt;br /&gt;
Alternatively TTY1 can be changed to TTY0 resulting in the trace printing on the main console.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
RFC 793&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3856</id>
		<title>UDP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3856"/>
		<updated>2011-06-17T18:45:07Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Resources ==&lt;br /&gt;
XINU implements UDP as per RFC 768&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
To enable UDP debugging, uncomment the following line in include/udp.h&lt;br /&gt;
 //#define TRACE_UDP     TTY1&lt;br /&gt;
&lt;br /&gt;
In order to see the trace results you open another console to the second serial port using the router name followed by the number 2.&lt;br /&gt;
 mips-console router2&lt;br /&gt;
Alternatively TTY1 can be changed to TTY0 resulting in the trace printing on the main console.&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TCP_Echo_Test&amp;diff=3850</id>
		<title>TCP Echo Test</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TCP_Echo_Test&amp;diff=3850"/>
		<updated>2011-06-16T21:22:45Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About ==&lt;br /&gt;
This is a simple TCP usage example. It is an echo test client that sends a message to the echo server and then prints out the reply.&lt;br /&gt;
The echo protocol is defined in RFC 862. In short, we send a message to the server, and the server echos the exact same message back.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
* Add the the to the shell directory as xsh_echotest.c&lt;br /&gt;
* Modify shell.c and shell.h to include the echotest command.&lt;br /&gt;
* Modify the Makefile in the shell directory to include xsh_echotest.c and then make XINU from the compile directory&lt;br /&gt;
* Boot XINU&lt;br /&gt;
* Run netup command from the shell&lt;br /&gt;
* Run echoclient from the shell with the arguments of the echoserver's ip and the message to be sent in quotes&lt;br /&gt;
**eg: echoclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot; &lt;br /&gt;
&lt;br /&gt;
== xsh_echotest.c ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;tcp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 7&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Shell command (echotest) sends a message to an echo server per RFC 862.&lt;br /&gt;
 * It waits for a response, then prints out the reply from the echo server.&lt;br /&gt;
 * Expects args: echotest, echo server ip, Message to echo in quotes&lt;br /&gt;
 * @param nargs number of arguments in args array&lt;br /&gt;
 * @param args  array of arguments&lt;br /&gt;
 * @return non-zero value on error&lt;br /&gt;
 */&lt;br /&gt;
shellcmd xsh_echotest(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
    int len;&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new TCP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = tcpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a TCP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the TCP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT, TCP_ACTIVE))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the TCP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
&lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Error writing packet to the network&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Read a response from the server */&lt;br /&gt;
    if(SYSERR != (len = read(dev, buf, MSG_MAX_LEN)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Client: Got response - %s\r\n&amp;quot;, buf);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Close the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3846</id>
		<title>UDP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3846"/>
		<updated>2011-06-13T21:47:17Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Replaced content with '== Resources ==
XINU implements UDP as per RFC 768'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Resources ==&lt;br /&gt;
XINU implements UDP as per RFC 768&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3845</id>
		<title>Simple UDP Example</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3845"/>
		<updated>2011-06-13T21:46:09Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About ===&lt;br /&gt;
This is a dead simple example of how to use the UDP networking features in XINU 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Add the both of the files to the shell directory as xsh_udpclient.c and xsh_udpserver.c&lt;br /&gt;
* Modify shell.c and shell.h to include the udpclient and udpserver commands.&lt;br /&gt;
* Modify the Makefile in the shell directory to include xsh_udpclient.c and xsh_udpserver.c and then make XINU from the compile directory&lt;br /&gt;
* Boot two separate XINU consoles&lt;br /&gt;
* Run netup command from the shell on both consoles&lt;br /&gt;
* Run udpserver from the shell on the first console&lt;br /&gt;
* Run udpclient from the shell on the second console with the arguments of the udpserver's ip and the message to be sent in quotes&lt;br /&gt;
** eg: udpclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
'''UDP Client'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (udpclient) runs a client that sends an ASCII message over the network to a server using UDP.&lt;br /&gt;
* Expects arg0 to be echoclient, args1 to be the destination IP address, args2 to be the message in quotes&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_udpclient(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a UDP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
    &lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
    &lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Closee the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UDP Server'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (udpserver) runs a UDP server that waits for an incoming message, and then prints it out. Does not expect any arguments.&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoserver(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    int len = 0;&lt;br /&gt;
&lt;br /&gt;
    char buffer[UDP_MAX_DATALEN];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
    struct udpPseudoHdr *pseudo;&lt;br /&gt;
    struct udpPkt *udp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Failed to allocate a UDP device.\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device using localhost and the echo port to listen to*/&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    if (SYSERR == open(dev, localhost, NULL, ECHO_PORT, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Set the UDP device to passive mode */&lt;br /&gt;
    if (SYSERR == control(dev, UDP_CTRL_SETFLAG, UDP_FLAG_PASSIVE, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        kprintf(&amp;quot;Server: Could not set UDP device to passive mode\r\n&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Read lop, wait for a new request */&lt;br /&gt;
    printf(&amp;quot;Server: Waiting for message\r\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    while (SYSERR != (len = read(dev, buffer, UDP_MAX_DATALEN)))&lt;br /&gt;
    {&lt;br /&gt;
        pseudo = (struct udpPseudoHdr *)buffer;&lt;br /&gt;
        udp = (struct udpPkt *)(pseudo + 1);&lt;br /&gt;
        printf(&amp;quot;Server: Received Message - %s\r\n&amp;quot;, udp-&amp;gt;data);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3844</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3844"/>
		<updated>2011-06-13T21:09:37Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;br /&gt;
&lt;br /&gt;
[[TCP Echo Test]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3843</id>
		<title>TCP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3843"/>
		<updated>2011-06-13T21:09:15Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Examples ==&lt;br /&gt;
[[TCP Echo Test]]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
RFC 793&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=ARP&amp;diff=3842</id>
		<title>ARP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=ARP&amp;diff=3842"/>
		<updated>2011-06-13T21:07:58Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About ==&lt;br /&gt;
XINU features an automatic address resolution protocol. The ARP daemon is run automatically on start up and waits for incoming ARP packets. Incoming packets are filtered through netRecv and ARP requests/replies are sent on to the ARP Daemon. &lt;br /&gt;
&lt;br /&gt;
On the other side, when sending packets, netSend will check the ARP table to see if it has a hardware address for the given IP. If there is no matching entry in the ARP table, an ARP request is sent and &lt;br /&gt;
&lt;br /&gt;
To print the ARP table run the arp command from the XINU shell:&lt;br /&gt;
 xsh@supervoc$ arp&lt;br /&gt;
&lt;br /&gt;
 Address                 HWaddress               Interface&lt;br /&gt;
 192.168.6.10            52:54:03:02:B1:06       ETH0&lt;br /&gt;
 192.168.6.101           00:16:B6:28:7D:4F       ETH0&lt;br /&gt;
 192.168.6.130           00:25:9C:3A:87:53       ETH0&lt;br /&gt;
&lt;br /&gt;
Currently there is no way to add/remove entries or clear the ARP table manually.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
RFC 826&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=ARP&amp;diff=3841</id>
		<title>ARP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=ARP&amp;diff=3841"/>
		<updated>2011-06-13T21:02:08Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with 'XINU features an automatic address resolution protocol. The ARP daemon is run automaticall on start up and waits for incoming arp packets. Incoming packets are filtered through n...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XINU features an automatic address resolution protocol. The ARP daemon is run automaticall on start up and waits for incoming arp packets. Incoming packets are filtered through netRecv and ARP requests/replies are sent on to the ARP Daemon.&lt;br /&gt;
&lt;br /&gt;
To print the arp table run the arp command from the XINU shell&lt;br /&gt;
eg&lt;br /&gt;
 xsh@supervoc$ arp&lt;br /&gt;
&lt;br /&gt;
 Address                 HWaddress               Interface&lt;br /&gt;
 192.168.6.10            52:54:03:02:B1:06       ETH0&lt;br /&gt;
 192.168.6.101           00:16:B6:28:7D:4F       ETH0&lt;br /&gt;
 192.168.6.130           00:25:9C:3A:87:53       ETH0&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=ICMP&amp;diff=3840</id>
		<title>ICMP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=ICMP&amp;diff=3840"/>
		<updated>2011-06-13T20:58:43Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XINU features an ICMP daemon that runs on start up and responds to ICMP echo requests(pings).&lt;br /&gt;
XINU can also send ICMP echo requests using the ping command and a valid ipv4 address.&lt;br /&gt;
In order to either send or reply to messages, the netup command needs to be run first.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
RFC 792&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=ICMP&amp;diff=3839</id>
		<title>ICMP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=ICMP&amp;diff=3839"/>
		<updated>2011-06-13T20:57:59Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with 'XINU features an ICMP daemon that runs on start up and responds to ICMP echo requests(pings). XINU can also send ICMP echo requests using the ping command and a valid ipv4 addres...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;XINU features an ICMP daemon that runs on start up and responds to ICMP echo requests(pings).&lt;br /&gt;
XINU can also send ICMP echo requests using the ping command and a valid ipv4 address.&lt;br /&gt;
In order to either send or reply to messages, the netup command needs to be run first.&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3838</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3838"/>
		<updated>2011-06-13T20:47:20Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;br /&gt;
&lt;br /&gt;
[[TCP_Echo_Test]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3837</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3837"/>
		<updated>2011-06-13T20:47:14Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;br /&gt;
[[TCP_Echo_Test]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Routing&amp;diff=3836</id>
		<title>Routing</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Routing&amp;diff=3836"/>
		<updated>2011-06-10T20:03:20Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with 'The routing daemon is automatically started with XINU.  == Add a Route == To add a route to the route entry table use route add with the following parameters:  route add &amp;lt;destina...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The routing daemon is automatically started with XINU.&lt;br /&gt;
&lt;br /&gt;
== Add a Route ==&lt;br /&gt;
To add a route to the route entry table use route add with the following parameters:&lt;br /&gt;
 route add &amp;lt;destination&amp;gt; &amp;lt;gateway&amp;gt; &amp;lt;mask&amp;gt; &amp;lt;interface&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 route add 192.168.6.0 192.168.1.100 255.255.255.0 ETH0&lt;br /&gt;
&lt;br /&gt;
== Delete a Route ==&lt;br /&gt;
To delete a route from the route entry table, use route del with the destination as the third parameter.&lt;br /&gt;
 route del &amp;lt;destination&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 route del 192.168.6.0&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3835</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3835"/>
		<updated>2011-06-10T19:52:53Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* [[Routing]]&lt;br /&gt;
* [[ICMP]]&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3834</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3834"/>
		<updated>2011-06-10T19:51:20Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* [[ARP]]&lt;br /&gt;
* Routing&lt;br /&gt;
* ICMP&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TCP_Echo_Test&amp;diff=3833</id>
		<title>TCP Echo Test</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TCP_Echo_Test&amp;diff=3833"/>
		<updated>2011-06-10T19:50:30Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with '== About == This is a simple TCP usage example. It is an echo test client that sends a message to the echo server and then prints out the reply. The echo protocol is defined in R...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About ==&lt;br /&gt;
This is a simple TCP usage example. It is an echo test client that sends a message to the echo server and then prints out the reply.&lt;br /&gt;
The echo protocol is defined in RFC 862. In short, we send a message to the server, and the server echos the exact same message back.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
* Add the the to the shell directory as xsh_echotest.c&lt;br /&gt;
* Modify shell.c and shell.h to include the echotest command.&lt;br /&gt;
* Modify the Makefile in the shell directory to include xsh_echotest.c and then make XINU from the compile directory&lt;br /&gt;
* Boot XINU&lt;br /&gt;
* Run netup command from the shell&lt;br /&gt;
* Run echoclient from the shell with the arguments of the echoserver's ip and the message to be sent in quotes&lt;br /&gt;
**eg: echoclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot; &lt;br /&gt;
&lt;br /&gt;
== echotest.c ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;tcp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 7&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Shell command (echotest) sends a message to an echo server per RFC 862.&lt;br /&gt;
 * It waits for a response, then prints out the reply from the echo server.&lt;br /&gt;
 * Expects args: echotest, echo server ip, Message to echo in quotes&lt;br /&gt;
 * @param nargs number of arguments in args array&lt;br /&gt;
 * @param args  array of arguments&lt;br /&gt;
 * @return non-zero value on error&lt;br /&gt;
 */&lt;br /&gt;
shellcmd xsh_echotest(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
    int len;&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new TCP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = tcpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a TCP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the TCP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT, TCP_ACTIVE))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
&lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Error writing packet to the network&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Read a response from the server */&lt;br /&gt;
    if(SYSERR != (len = read(dev, buf, MSG_MAX_LEN)))&lt;br /&gt;
    {&lt;br /&gt;
        printf(&amp;quot;Client: Got response - %s\r\n&amp;quot;, buf);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Close the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3832</id>
		<title>TCP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=TCP&amp;diff=3832"/>
		<updated>2011-06-10T19:45:19Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with ' == Examples == TCP Echo Test'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[TCP Echo Test]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3831</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3831"/>
		<updated>2011-06-10T19:44:44Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* [[TCP]]&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* ARP&lt;br /&gt;
* Routing&lt;br /&gt;
* ICMP&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3830</id>
		<title>UDP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3830"/>
		<updated>2011-06-10T18:31:46Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About ==&lt;br /&gt;
XINU implements UDP as per RFC 768&lt;br /&gt;
&lt;br /&gt;
== Sending data over UDP ==&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Allocate a new UDP device.'''&lt;br /&gt;
:Use udpAlloc to get a device number for a udp device. If allocation fails, the device number returned will be SYSERR.&lt;br /&gt;
 dev = tcpAlloc())&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Get the local ip address'''&lt;br /&gt;
:Use netLookup to find our local ip address. &lt;br /&gt;
:If interface is NULL, then we don't have a valid network interface. &lt;br /&gt;
This usually happens when a user forgets to run the netup command.&lt;br /&gt;
&lt;br /&gt;
 interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
 localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
'''Step3: Open the UDP device'''&lt;br /&gt;
:To open the device simply call open( ) with the following arguments:&lt;br /&gt;
&lt;br /&gt;
#The UDP device number&lt;br /&gt;
#Our local ip address&lt;br /&gt;
#The destination's ip address&lt;br /&gt;
#The local port to use&lt;br /&gt;
#The remote port to connect to&lt;br /&gt;
&lt;br /&gt;
 open(dev, localIP, dstIP, localPort, remotePort)&lt;br /&gt;
&lt;br /&gt;
Again if open fails, SYSERR is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 4: Send the packet'''&lt;br /&gt;
:To actually send the data, use write( ) with the device, buffer, and length arguments.&lt;br /&gt;
:The actual data you want to send will be written to the buffer. The length arg is the length of the buffer.&lt;br /&gt;
  write(dev, buf, MSG_MAX_LEN)&lt;br /&gt;
&lt;br /&gt;
As usual, write returns SYSERR if it fails.&lt;br /&gt;
&lt;br /&gt;
'''Step 5: Close the connection'''&lt;br /&gt;
:Once the device is finish being used, be responsible and call close to return the device.&lt;br /&gt;
 close(dev);&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3829</id>
		<title>UDP</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=UDP&amp;diff=3829"/>
		<updated>2011-06-10T18:29:49Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with '== Sending data over UDP ==  '''Step 1: Allocate a new UDP device.''' :Use udpAlloc to get a device number for a udp device. If allocation fails, the device number returned will ...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Sending data over UDP ==&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Allocate a new UDP device.'''&lt;br /&gt;
:Use udpAlloc to get a device number for a udp device. If allocation fails, the device number returned will be SYSERR.&lt;br /&gt;
 dev = tcpAlloc())&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Get the local ip address'''&lt;br /&gt;
:Use netLookup to find our local ip address. &lt;br /&gt;
:If interface is NULL, then we don't have a valid network interface. &lt;br /&gt;
This usually happens when a user forgets to run the netup command.&lt;br /&gt;
&lt;br /&gt;
 interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
 localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
'''Step3: Open the UDP device'''&lt;br /&gt;
:To open the device simply call open( ) with the following arguments:&lt;br /&gt;
&lt;br /&gt;
#The UDP device number&lt;br /&gt;
#Our local ip address&lt;br /&gt;
#The destination's ip address&lt;br /&gt;
#The local port to use&lt;br /&gt;
#The remote port to connect to&lt;br /&gt;
&lt;br /&gt;
 open(dev, localIP, dstIP, localPort, remotePort)&lt;br /&gt;
&lt;br /&gt;
Again if open fails, SYSERR is returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 4: Send the packet'''&lt;br /&gt;
:To actually send the data, use write( ) with the device, buffer, and length arguments.&lt;br /&gt;
:The actual data you want to send will be written to the buffer. The length arg is the length of the buffer.&lt;br /&gt;
  write(dev, buf, MSG_MAX_LEN)&lt;br /&gt;
&lt;br /&gt;
As usual, write returns SYSERR if it fails.&lt;br /&gt;
&lt;br /&gt;
'''Step 5: Close the connection'''&lt;br /&gt;
:Once the device is finish being used, be responsible and call close to return the device.&lt;br /&gt;
 close(dev);&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3828</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3828"/>
		<updated>2011-06-10T17:19:52Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* TCP&lt;br /&gt;
* [[UDP]]&lt;br /&gt;
* ARP&lt;br /&gt;
* Routing&lt;br /&gt;
* ICMP&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3827</id>
		<title>Simple UDP Example</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3827"/>
		<updated>2011-06-08T21:50:10Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About ===&lt;br /&gt;
This is a dead simple example of how to use the UDP networking features in XINU 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Add the both of the files to the shell directory as xsh_echoclient.c and xsh_echserver.c&lt;br /&gt;
* Modify shell.c and shell.h to include the echoclient and echoserver commands.&lt;br /&gt;
* Modify the Makefile in the shell directory to include xsh_echoserver.c and xsh_echoclient.c and then make XINU from the compile directory&lt;br /&gt;
* Boot two separate XINU consoles&lt;br /&gt;
* Run netup command from the shell on both consoles&lt;br /&gt;
* Run testserver from the shell on the first console&lt;br /&gt;
* Run echoclient from the shell on the second console with the arguments of the echoserver's ip and the message to be sent in quotes&lt;br /&gt;
** eg: echoclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
'''Echo Client'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoclient) runs a client that sends an ASCII message over the network to a server using UDP.&lt;br /&gt;
* Expects arg0 to be echoclient, args1 to be the destination IP address, args2 to be the message in quotes&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoclient(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a UDP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
    &lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
    &lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Closee the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Echo Server'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoserver) runs a UDP server that waits for an incoming message, and then prints it out. Does not expect any arguments.&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoserver(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    int len = 0;&lt;br /&gt;
&lt;br /&gt;
    char buffer[UDP_MAX_DATALEN];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
    struct udpPseudoHdr *pseudo;&lt;br /&gt;
    struct udpPkt *udp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Failed to allocate a UDP device.\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device using localhost and the echo port to listen to*/&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    if (SYSERR == open(dev, localhost, NULL, ECHO_PORT, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Set the UDP device to passive mode */&lt;br /&gt;
    if (SYSERR == control(dev, UDP_CTRL_SETFLAG, UDP_FLAG_PASSIVE, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        kprintf(&amp;quot;Server: Could not set UDP device to passive mode\r\n&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Read lop, wait for a new request */&lt;br /&gt;
    printf(&amp;quot;Server: Waiting for message\r\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    while (SYSERR != (len = read(dev, buffer, UDP_MAX_DATALEN)))&lt;br /&gt;
    {&lt;br /&gt;
        pseudo = (struct udpPseudoHdr *)buffer;&lt;br /&gt;
        udp = (struct udpPkt *)(pseudo + 1);&lt;br /&gt;
        printf(&amp;quot;Server: Received Message - %s\r\n&amp;quot;, udp-&amp;gt;data);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3826</id>
		<title>Simple UDP Example</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3826"/>
		<updated>2011-06-08T21:39:14Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About ===&lt;br /&gt;
This is a dead simple example of how to use the UDP networking features in XINU 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Add the both of the files to the shell directory as xsh_echoclient.c and xsh_echserver.c&lt;br /&gt;
* Modify shell.c and shell.h to include the echoclient and echoserver commands.&lt;br /&gt;
* Boot two separate XINU consoles&lt;br /&gt;
* Run netup command from the shell on both consoles&lt;br /&gt;
* Run testserver on the first console&lt;br /&gt;
* Run echoclient with the arguments of the echoserver's ip and the message to be sent in quotes&lt;br /&gt;
** eg: echoclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
'''Echo Client'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoclient) runs a client that sends an ASCII message over the network to a server using UDP.&lt;br /&gt;
* Expects arg0 to be echoclient, args1 to be the destination IP address, args2 to be the message in quotes&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoclient(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a UDP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
    &lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
    &lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Closee the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Echo Server'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoserver) runs a UDP server that waits for an incoming message, and then prints it out. Does not expect any arguments.&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoserver(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    int len = 0;&lt;br /&gt;
&lt;br /&gt;
    char buffer[UDP_MAX_DATALEN];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
    struct udpPseudoHdr *pseudo;&lt;br /&gt;
    struct udpPkt *udp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Failed to allocate a UDP device.\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device using localhost and the echo port to listen to*/&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    if (SYSERR == open(dev, localhost, NULL, ECHO_PORT, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Set the UDP device to passive mode */&lt;br /&gt;
    if (SYSERR == control(dev, UDP_CTRL_SETFLAG, UDP_FLAG_PASSIVE, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        kprintf(&amp;quot;Server: Could not set UDP device to passive mode\r\n&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Read lop, wait for a new request */&lt;br /&gt;
    printf(&amp;quot;Server: Waiting for message\r\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    while (SYSERR != (len = read(dev, buffer, UDP_MAX_DATALEN)))&lt;br /&gt;
    {&lt;br /&gt;
        pseudo = (struct udpPseudoHdr *)buffer;&lt;br /&gt;
        udp = (struct udpPkt *)(pseudo + 1);&lt;br /&gt;
        printf(&amp;quot;Server: Received Message - %s\r\n&amp;quot;, udp-&amp;gt;data);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3825</id>
		<title>Simple UDP Example</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Simple_UDP_Example&amp;diff=3825"/>
		<updated>2011-06-08T21:38:40Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with '=== About === This is a dead simple example of how to use the UDP networking features in XINU 2.0.   === Usage === * Add the both of the files to the shell directory as xsh_echoc...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About ===&lt;br /&gt;
This is a dead simple example of how to use the UDP networking features in XINU 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* Add the both of the files to the shell directory as xsh_echoclient.c and xsh_echserver.c&lt;br /&gt;
* Modify shell.c and shell.h to include the echoclient and echoserver commands.&lt;br /&gt;
* Boot two separate XINU consoles&lt;br /&gt;
* Run netup command from the shell on both consoles&lt;br /&gt;
* Run testserver on the first console&lt;br /&gt;
* Run echoclient with the arguments of the echoserver's ip command and the message to be sent in quotes&lt;br /&gt;
** eg: echoclient 192.168.6.102 &amp;quot;Hello XINU World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Source ===&lt;br /&gt;
'''Echo Client'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define MSG_MAX_LEN 64&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoclient) runs a client that sends an ASCII message over the network to a server using UDP.&lt;br /&gt;
* Expects arg0 to be echoclient, args1 to be the destination IP address, args2 to be the message in quotes&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoclient(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    char buf[MSG_MAX_LEN];&lt;br /&gt;
&lt;br /&gt;
    char *dest = args[1];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr dst;&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to allocate a UDP device.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
    &lt;br /&gt;
    /* Change the destination to ipv4 */&lt;br /&gt;
    if (SYSERR == dot2ipv4(dest, &amp;amp;dst))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Failed to convert ip address.&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device with the destination and echo port*/&lt;br /&gt;
    if (SYSERR == open(dev, localhost, &amp;amp;dst, NULL, ECHO_PORT))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Client: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Send the message to the destination*/&lt;br /&gt;
    memcpy(buf, args[2], MSG_MAX_LEN);&lt;br /&gt;
    &lt;br /&gt;
    if(SYSERR == write(dev, buf, MSG_MAX_LEN))&lt;br /&gt;
    {&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Closee the device when done */&lt;br /&gt;
    close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Echo Server'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;lt;stddef.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;device.h&amp;gt;&lt;br /&gt;
#include &amp;lt;udp.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ether.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define ECHO_PORT 9989&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Shell command (echoserver) runs a UDP server that waits for an incoming message, and then prints it out. Does not expect any arguments.&lt;br /&gt;
* @param nargs number of arguments in args array&lt;br /&gt;
* @param args array of arguments&lt;br /&gt;
* @return non-zero value on error&lt;br /&gt;
*/&lt;br /&gt;
shellcmd xsh_echoserver(int nargs, char *args[])&lt;br /&gt;
{&lt;br /&gt;
    ushort dev = 0;&lt;br /&gt;
    int len = 0;&lt;br /&gt;
&lt;br /&gt;
    char buffer[UDP_MAX_DATALEN];&lt;br /&gt;
&lt;br /&gt;
    struct netaddr *localhost;&lt;br /&gt;
&lt;br /&gt;
    struct netif *interface;&lt;br /&gt;
    struct udpPseudoHdr *pseudo;&lt;br /&gt;
    struct udpPkt *udp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Allocate a new UDP device */&lt;br /&gt;
    if ((ushort)SYSERR == (dev = udpAlloc()))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Failed to allocate a UDP device.\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Look up local ip info */&lt;br /&gt;
    interface = netLookup((ethertab[0].dev)-&amp;gt;num);&lt;br /&gt;
&lt;br /&gt;
    if (NULL == interface)&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: No network interface found\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Open the UDP device using localhost and the echo port to listen to*/&lt;br /&gt;
    localhost = &amp;amp;(interface-&amp;gt;ip);&lt;br /&gt;
&lt;br /&gt;
    if (SYSERR == open(dev, localhost, NULL, ECHO_PORT, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        fprintf(stderr, &amp;quot;Server: Could not open the UDP device\r\n&amp;quot;);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Set the UDP device to passive mode */&lt;br /&gt;
    if (SYSERR == control(dev, UDP_CTRL_SETFLAG, UDP_FLAG_PASSIVE, NULL))&lt;br /&gt;
    {&lt;br /&gt;
        kprintf(&amp;quot;Server: Could not set UDP device to passive mode\r\n&amp;quot;);&lt;br /&gt;
        close(dev);&lt;br /&gt;
        return SYSERR;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    /* Read lop, wait for a new request */&lt;br /&gt;
    printf(&amp;quot;Server: Waiting for message\r\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    while (SYSERR != (len = read(dev, buffer, UDP_MAX_DATALEN)))&lt;br /&gt;
    {&lt;br /&gt;
        pseudo = (struct udpPseudoHdr *)buffer;&lt;br /&gt;
        udp = (struct udpPkt *)(pseudo + 1);&lt;br /&gt;
        printf(&amp;quot;Server: Received Message - %s\r\n&amp;quot;, udp-&amp;gt;data);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
        close(dev);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3824</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3824"/>
		<updated>2011-06-08T21:38:21Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* TCP&lt;br /&gt;
* UDP&lt;br /&gt;
* ARP&lt;br /&gt;
* Routing&lt;br /&gt;
* ICMP&lt;br /&gt;
&lt;br /&gt;
== Network Graphic ==&lt;br /&gt;
* [[Media:XINUNetStack-Screen.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack-Print.jpeg]]&lt;br /&gt;
* [[Media:XINUNetStack.pdf]]&lt;br /&gt;
[[File:XINUNetStack-Screen.jpeg|border|500px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
[[Simple UDP Example]]&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack-Screen.jpeg&amp;diff=3823</id>
		<title>File:XINUNetStack-Screen.jpeg</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack-Screen.jpeg&amp;diff=3823"/>
		<updated>2011-06-08T21:32:55Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: 160 DPI version of the XINU network map&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;160 DPI version of the XINU network map&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack.pdf&amp;diff=3822</id>
		<title>File:XINUNetStack.pdf</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack.pdf&amp;diff=3822"/>
		<updated>2011-06-08T21:32:29Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: PDF version of the XINU network map&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PDF version of the XINU network map&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack-Print.jpeg&amp;diff=3821</id>
		<title>File:XINUNetStack-Print.jpeg</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=File:XINUNetStack-Print.jpeg&amp;diff=3821"/>
		<updated>2011-06-08T21:31:30Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: 300 DPI print version of the XINU network map&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;300 DPI print version of the XINU network map&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3820</id>
		<title>Networking</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Networking&amp;diff=3820"/>
		<updated>2011-06-08T21:29:03Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: Created page with '= XINU Networking Features = * TCP * UDP * ARP * Routing * ICMP'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= XINU Networking Features =&lt;br /&gt;
* TCP&lt;br /&gt;
* UDP&lt;br /&gt;
* ARP&lt;br /&gt;
* Routing&lt;br /&gt;
* ICMP&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Main_Page&amp;diff=3819</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Main_Page&amp;diff=3819"/>
		<updated>2011-06-08T21:28:29Z</updated>

		<summary type="html">&lt;p&gt;Jcowdy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Embedded Xinu is an ongoing research and implementation project in the area of Operating Systems and Embedded Systems.  Its goal is to port the [[Xinu|Xinu Operating System]] to the embedded MIPS platform.  The current release supports Linksys WRT54GL and WRT160NL routers, as well as the Qemu virtual machine.  While this project is still in progress, our laboratory environment and curriculum materials are already in use for courses in Operating Systems, Hardware Systems, Embedded Systems, Networking and Compilers.&lt;br /&gt;
&lt;br /&gt;
The Embedded Xinu project was conceived and is supervised by [http://www.mscs.mu.edu/~brylow/ Dr. Dennis Brylow] and is being conducted by both graduate and undergraduate students in the [[Systems Laboratory]] in the [http://www.mscs.mu.edu/ Math, Statistics, &amp;amp; Computer Science] department of [http://www.mu.edu/ Marquette University] in Milwaukee, Wisconsin.  The first major phase of work on Embedded Xinu began in the Summer of 2006.&lt;br /&gt;
&lt;br /&gt;
Our project partners include [http://www.cse.buffalo.edu/~bina/ Dr. Bina Ramamurthy] at University of Buffalo (with whom we shared an [http://www.nsf.gov/pubs/2009/nsf09529/nsf09529.html NSF CCLI] grant), [http://cs.olemiss.edu/~ruth/wiki/doku.php Dr. Paul Ruth] at University of Mississippi, and [http://www.cs.purdue.edu/people/comer Dr. Doug Comer] (father of Xinu) at Purdue University.&lt;br /&gt;
&lt;br /&gt;
== Teaching With Embedded Xinu ==&lt;br /&gt;
&lt;br /&gt;
* Join us for the [http://www.cs.olemiss.edu/acmse2010/pdf/xinu.pdf Teaching With Embedded Xinu Workshop] at [http://www.cs.olemiss.edu/acmse2010/Home.htm ACMSE 2010] in Oxford, Mississippi (Ole Miss campus) April 15.  This workshop will share ready-made curriculum resources that have been used successfully to teach hardware systems, operating systems, realtime/embedded systems, networking, and compilers with the Embedded Xinu platform at several colleges/universities. Commodity wireless router hardware or equivalent virtual machines, combined with freely-available software and tools, make for a powerful and flexible learning platform without having to fake any components. Come see what Nexos has to offer for your program.&lt;br /&gt;
&lt;br /&gt;
* For curriculum guidance on adopting or adapting Embedded Xinu for undergraduate coursework, see [[Teaching With Xinu]].&lt;br /&gt;
&lt;br /&gt;
== Building an Embedded Xinu Laboratory ==&lt;br /&gt;
&lt;br /&gt;
In this section we are developing instructions so that other groups can benefit from the work we are doing.  These guides can be followed more or less in order to create a relatively inexpensive platform for a custom operating system.  As our work develops further, there will be more Xinu-specific information.&lt;br /&gt;
&lt;br /&gt;
# Obtain a [[List of supported platforms|supported platform]].&lt;br /&gt;
# [[HOWTO:Modify the Linksys hardware|Modify the Linksys hardware]] or [[HOWTO:Modify the ASUS hardware|Modify the ASUS hardware]]&lt;br /&gt;
# [[HOWTO:Connect to a modified router|Connect to a modified router]]&lt;br /&gt;
# [[HOWTO:Build Xinu|Build Xinu]]&lt;br /&gt;
# [[HOWTO:Deploy Xinu|Deploy Xinu]]&lt;br /&gt;
# (Optional) [[HOWTO:Build Backend Pool|Build a pool of backends]]&lt;br /&gt;
&lt;br /&gt;
== Other Embedded Xinu Information ==&lt;br /&gt;
&lt;br /&gt;
* MIPS [[processor]]&lt;br /&gt;
* Main [[memory]]&lt;br /&gt;
* [[Exception and Interrupt Handling]]&lt;br /&gt;
* [[UART driver]]&lt;br /&gt;
* [[TTY driver]]&lt;br /&gt;
* [[Switch driver]]&lt;br /&gt;
* [[Networking]]&lt;br /&gt;
* [[Flash memory]]&lt;br /&gt;
* [[EJTAG|Enhanced Joint Test Action Group]] debugger&lt;br /&gt;
* [[Standard library]]&lt;br /&gt;
* [[XinuPhone]] Internet telephony&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;lt;small&amp;gt;&amp;lt;small&amp;gt;The Xinu Lab is brought to you in part by [[XMMS|M&amp;amp;M's]].&amp;lt;/small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
--&amp;gt;__NOTOC__&amp;lt;!-- Disable &amp;quot;Contents&amp;quot; box from showing --&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;__NOEDITSECTION__&amp;lt;!-- Disable [edit] from appearing --&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jcowdy</name></author>
		
	</entry>
</feed>