IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New I'd go with socket basics.
It's not that difficult conceptually, and will make How It All Works much clearer than any other thing you can do. After all, once you get the connection made and can pass text back and forth, creating a service is just all about how it's processed at each end.

To my mind, I'd start with the socket basics, keep it quite basic, and point them at further info if they wish to follow up on their own. After seeing how sockets work, showing them the kinds of things you can do with nmap etc will be much much clearer to them. Start down near the root, and move the course further up the tree as it progresses.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New Re: I'd go with socket basics.
Server:
#!/usr/bin/python\n\nimport sys, socket\n\nif (len(sys.argv) < 2):\n    sys.exit('Must supply port!\\n')\n\nport = sys.argv[1]\nhost = socket.gethostbyname(socket.gethostname())\n\nprint '%s:%s Listening:\\n' % (host, port)\n\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\ntry:\n    sock.bind((host, int(port)))\n    sock.listen(1)\n\n    conn, addr = sock.accept()\n    print 'Connection from: ' + str(addr)\n\n    str = conn.recv(1024)\n    print 'Echoing "%s"' % (str)\n    conn.send(str)\n\n    conn.close()\n\nexcept socket.error, (errno, errstr):\n    conn.close()\n    sys.exit("Error: %s!" % (errstr))


Client:
#!/usr/bin/python\n\nimport sys, socket\n\nif (len(sys.argv) < 4):\n    sys.exit('Must supply host, port, and text string to send!\\n')\n\n(host, port, string) = sys.argv[1:]\n\nprint '%s:%s Sending: %s\\n' % (host, port, string)\n\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\ntry:\n    sock.connect((host, int(port)))\n    sock.sendall('%s\\n' % (string))\n    recv = ''\n    while 1:\n        str = sock.recv(1024)\n        if not str: break\n        recv += str\n\nexcept socket.error, (errno, errstr):\n    sock.close()\n    sys.exit("Error: %s!" % (errstr))\n\nprint "Received:\\n" + recv
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Didn't say it would take very long
:)

Of course, for the students that DON'T know programming, learning that will take quite a bit longer; OTOH, once they DO grok it, they will be much better positioned to correctly grok computers in general.

There are a LOT of users that have very, ummm, odd intellectual models of what's actually going on in there.

Cue Tom Waits as appropriate.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New Programming Languages will influence the model
So one must be careful to choose a PL that has the proper level of abstraction for the lesson to be taught and the model to be molded. If you want them to understand it in terms of bits and bytes and machine instructions, C and it's ilk is the way to go. If you want them to understand it as a set of libraries that can be slowly dissected, then Python and similar languages can be the way to go.

Either way, both are really just models for the more abstract thought of network transport.
New Indeed
and I think a higher level view than C is the one for this. I might get a kick out of bit hacking from time to time, but I'm funny and strange.

The key concept is two apps, one with a listen socket and one connecting to it, exchanging data through a series of read and write operations to their end of the socket. Once they grok that, then things like the output (in OS/2) of
iptrace && ipformat
get a lot easier to figure out.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New Definitely want high level languages

Keep this at the upper levels of the TCP/IP stack.


Tom Sinclair

Crowley was in Hell's bad books. Not that Hell has any other kind.
-- (Terry Pratchett & Neil Gaiman, Good Omens)
New Yep.

------

179. I will not outsource core functions.
--
[link|http://omega.med.yale.edu/~pcy5/misc/overlord2.htm|.]

     Simple network programming language? - (tjsinclair) - (51)
         Python. - (folkert)
         What Greg said. - (admin) - (3)
             That's exactly what I was thinking - (tjsinclair) - (2)
                 cautions, cause.. - (cforde) - (1)
                     Understood - (tjsinclair)
         REBOL gets you there the fastest - (ChrisR) - (4)
             Agreed. - (admin)
             I considered Java briefly - (tjsinclair) - (2)
                 Definietly not Java or anything with a compiler - (tuberculosis) - (1)
                     Granted - (tjsinclair)
         perl, creating sockets and listening is fairly easy -NT - (boxley) - (35)
             Thanks for the tip - (tjsinclair)
             But not as readable as Python. - (admin) - (33)
                 This isn't readable? - (broomberg) - (32)
                     Ben could reduce that to about 12 characters... ;-) -NT - (Another Scott) - (15)
                         Of course he could - (broomberg) - (14)
                             :-) Yup, but in Python one can't do that. - (Another Scott) - (11)
                                 Hmm - (broomberg) - (10)
                                     Write That Code! - (Another Scott)
                                     Sorry I'm late to the Party ... Ruby Version - (JimWeirich) - (8)
                                         Where's the error handling? - (admin) - (7)
                                             I wouldn't bet that it is missing - (ben_tilly) - (6)
                                                 OK, fine... but - (admin) - (5)
                                                     As I said... - (ben_tilly) - (4)
                                                         Near enough to Python, then. - (admin) - (3)
                                                             Re: Near enough to Python, then. - (JimWeirich) - (2)
                                                                 As I said... - (admin) - (1)
                                                                     Ahh, makes me long for the old days - (broomberg)
                             Oops. -NT - (inthane-chan)
                             ICJRLPD (new thread) - (inthane-chan)
                     As I said, "not AS readable as the Python" - (admin) - (15)
                         Not bad - (broomberg) - (4)
                             What. He. Said. - (jb4) - (3)
                                 WTF do YOU think it has on it...? - (admin)
                                 I don't think you'll be surprised. (img) - (Another Scott)
                                 Hiss - (ChrisR)
                         Wel, it's beautiful code - (Arkadiy) - (9)
                             Use the socket libraries then. - (admin)
                             It's introduction to networking - (tjsinclair) - (7)
                                 I'd go with socket basics. - (jake123) - (6)
                                     Re: I'd go with socket basics. - (admin) - (5)
                                         Didn't say it would take very long - (jake123) - (3)
                                             Programming Languages will influence the model - (ChrisR) - (2)
                                                 Indeed - (jake123) - (1)
                                                     Definitely want high level languages - (tjsinclair)
                                         Yep. -NT - (Arkadiy)
         I'd suggest Ruby... - (ben_tilly) - (2)
             I believe I stole that example from it - (broomberg)
             I'm thinking of quick and dirty HOWTO here - (tjsinclair)
         Consider Object REXX - (jake123) - (1)
             Thanks for the reminder - (tjsinclair)

It's Lord of the Flies, but with iPhones.
90 ms