Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nslay

Pages: 1 ... 50 51 [52]
766
Unix / Linux Discussion / Re: dunno much about linux
« on: August 13, 2006, 10:30:17 pm »
Linux is pretty much commanding stuff using a command prompt instead of using a mouse right?

LOL

And *now* you know why the world uses Windows. :P

Myndfyre makes a good point.  No matter how much X does for us is respect to graphical environments, it is still separated from system over a matter of "policy vs mechanism."  That is to say, X does not provide any means to do simple tasks such as shutting down the system or configuring a network interface.  Unix users insist on pure mechanism forgetting that extremism on either side of the issue is bad.
Here is an example where pure mechanism fails:
Say you're a color blind user.  X, for all practical purposes, does not implement a standard toolkit (ok it does, but it sucks major assage, try xcalc out for size).  Hence, we have GTK, Qt, Wings and Motif.  Okay...and how does X let you control the color scheme used by GTK Firefox, as opposed to Motif Opera?  Simple...it doesn't.
But, the authors of X and the toolkits don't want to impose "policy"..."policy" is a bad word in Unix world. 

The above is just an example of the lameness of the Unix world.  That's why you have to open a term to do system specific tasks.  I don't care what window manager or DE you use, you still have to open terms to do things ... we're in a modern age, people expect to press buttons and get results, terminals have long died and gone.  That's why people use Windows and OS X.  I don't care who you are, if you don't see that people want to press buttons, you're a complete moron.

That said, Apple is an inspiration demonstrating how one can integrate a fully functional graphical environment into Unix ... not a partial one like X.

Although, these are sour points of Unix.  Let's not forget Unix has many good points to it too.

767
General Discussion / Re: New Laptop
« on: August 13, 2006, 09:01:13 pm »
It's your choice, really. I'd go with the IBM, personally. I have not had a problem with Dell though (I am using an Inspiron 8100 w/ FreeBSD 6.0 and it works 100% fine, the only problem is suspend but I don't suspend so it's not a problem. :)) so in reality there's no difference.

If you have to use Windows, that sucks. Why do you have to use Windows?

It's his preference  :-\  Although, whatever works.

768
General Discussion / Re: New Laptop
« on: August 13, 2006, 08:26:01 pm »
And?  ACPI is the subsystem that controls the fans, power and so forth.
Ah, cool.  I didn't know that.
Yeah, you don't hear about ACPI in Windows much. I doubt the DeLL computer would overheat either ... although I've heard Skywing has had problems with his older P4 laptop.

769
General Discussion / Re: New Laptop
« on: August 13, 2006, 08:20:18 pm »
IBM laptop's ACPI settings are extremely conservative.  I have an older Thinkpad T40 running 24/7 as a misc server/jukebox back home.
Newer technology heats up much more than older technology.
And?  ACPI is the subsystem that controls the fans, power and so forth.  I've yet to have a thinkpad overheat on me.
This new T43 that I have, I literally use all day for work, even computationally heavy work.

770
General Discussion / Re: New Laptop
« on: August 13, 2006, 08:12:42 pm »
How exactly do you plan to keep these laptops cool?
IBM laptop's ACPI settings are extremely conservative.  I have an older Thinkpad T40 running 24/7 as a misc server/jukebox back home.

771
General Discussion / Re: New Laptop
« on: August 13, 2006, 08:11:13 pm »
Don't forget the student discount :)
I know for sure IBM gives a discount for students.

EDIT:
To note, IBM Laptops are extremely well suited to other operating systems besides Windows.  I run a IBM Thinkpad T43 with FreeBSD 6.1...everything except for the winmodem works.  Even the thumbprint reader works...and I use it for everything from su to xdm.  Of course, it is a thrill when things work for non-Windows users :)

772
New Project Announcements / Re: P2P VLAN
« on: August 13, 2006, 06:06:24 am »
The real software will probably use UDP since it is probably bad to encapsulate a reliable protocol TCP/IP into TCP/IP packets.  But the bigger issue is how to deal with liars.  A liar is a peer that behaves badly and wrongfully responds to requests and perhaps uses other malicious tatics to damage the network.

There's no real way to deal with a liar. You could send a bogus packet through, (in your example, let's say you want to communicate with someone who has the Joker card, but it was removed) and if someone responds with "yes i know who has the joker card" you could simply drop him as a friend and route nothing through him, since he's not trustworthy. And if everyone does this on the net eventually he'll basically be cut off from the network and no one can talk to him. At that point, you can adjust the route table accordingly. Sadly one could write a decent malicious program that could recognize bogus packets. Another method would be to replace the bogus card with your own card, and see if your friends know who has it. Unfortunately this could fail because your "friends" should know you have it, and if a malicious person is your friend he could easily act properly.

Those are just two suggestions.

Nice write-up, by the way.

Yeah.  It's a difficult problem, especially since even the mallicious users are perfectly anonymous.  It's really a pitty the creators of TCP/IP didn't use a public key address system.  This would solve nearly every problem.
However, as mentioned above a simple solution would be to:
1) Generate a public/private key pair
2) Take a cryptographic hash of the public key
3) mod the hash by ~netmask

The result is the remaining bits of the IP address and the public key is used for negotiating encryption between two nodes.  On a route response, a node must append its public key so that the querier can encrypt an encryption key to use for communication (like 3DES, AES, Blowfish etc...).  To note, it is now very easy to verify a genuine response.  A peer forwarding a response just need perform steps 2 and 3 to verify the response.

You might wonder why a cryptographic hash is desirable.  Consider a simple mathematical function as f(x)=x^4 (x to the 4th power).
If we hash the number 2 we get f(2)=16.
Now note that this hash can be reversed to a degree.
f(x)=16 when x=+/-2, +/-2i

I believe ssh uses 2048 bit keys, so suppose your domain is [0,2^2048) (2^2048 is 617 digits in base 10)
Try that with md5 or SHA-1

One could use rainbow tables to search for possible input, but generating the rainbow table would be time consuming and certainly one would need a large pocket to do it.  Secondly, a 2048bit public key is a product of two very large prime numbers, cerca 2^1024.  What are the odds that any old number you pick has that property?

So, its extremely difficult to spoof route responses with this idea.

773
New Project Announcements / P2P VLAN
« on: August 11, 2006, 07:56:43 am »
Peer-to-peer (P2P) is a buzz word these days.  It is an umbrella term for any sort of communication that is decentralized from small scale direct-connect on AIM to large scale file sharing.  A Virtual LAN (VLAN) is a logical network that exists ontop of an existing network.  It is similar to a VPN but is independent of the real network.  It's usually used to network host and multiple virtual machines together, an invaluable test tool.
Combining the two ideas could yield an invaluable networking tool that transcends network topologies such as NATs and firewalls and yet is independent of dedicated servers.  It would allow friends and family to network their machines near and far.  A similar tool exists called Hamachi, however it isn't truly P2P.  It still relies on the vendor's server to coordinate networks.  However, a P2P VLAN has more powerful implications besides transcending network topologies.  It can have other features such as true anonymity, use multiple peers as one logical tunnel, and encrypt underlying communication between two nodes.
The concept of a P2P VLAN is based on a very simple and straightforward analogy.  Suppose there is a room full of people and suppose each person has friends.  Now suppose that each person has a concealed card from a standard 52 card deck.  Only the owner of the card knows his/her card.  Now, if one were to pass a message to the owner of the Ace of Diamonds (AD), one would need to know where to send data.  To solve this problem, one asks each of one's friends who has the AD and those friends repeat the process.  The owner of the AD can respond that he/she knows who has the AD without revealing that he/she has the AD.  Eventually that response reaches the original querier and most likely through multiple friends.  To note, one cannot conclude who has the AD since the response could have been forwarded.  Now the original queier can pass a message by having friends relay the message.  Remember, he/she may have many different routes and can randomize which friend he/she relays a message through.  The effect?  Nobody knows who has the AD yet communication can take place.  In this analogy, the friends are directly connected peers and the cards represent IP addresses.
To test this idea, I wrote a demonstration that uses the tun(4) psuedo network interface.  It intializes a tun interface and then attempts to connect to each peer, up to M peers in a list file.  The demonstration code does not choose an IP, one must manually configure the tun interface.  Since our primary concern is routing, I conducted a test with three machines and forced a specific network configuration.
Our three machines:
LIGHTBULB - 172.23.0.1
BLENDER - 172.23.0.2
BOTTLE - 172.23.0.3

I forced a configuration of:
BOTTLE <-> LIGHTBULB <-> BLENDER

I did this by stripping the peer list file from BOTTLE and BLENDER.  I chose this network configuration so BLENDER and BOTTLE are forced to route through LIGHTBULB when communicating with each other.  This would demonstrate the routing technique described in our analogy above.
In order to coordinate the network, I designed a simple protocol based on battle.net's message format.
Code: [Select]
/* This header defines various events.
 * Protocol format:
 * <uint8_t event><uint16_t size><void>
 * void is event specific ... all comments below refer to void format.
 * The protocol is still in development.
 */

#ifndef PROTO_H
#define PROTO_H

/* Authorization technique.
 * peer1 connects to peer2
 * peer1 -> uint8_t clientid
 * peer2 -> uint8_t clientid
 * peer2 -> P2PI_CLIENTINFOS
 * peer1 -> P2PI_CLIENTINFOR
 */

/* Other semantics not yet determined */

/* Non-existent Client ID */
#define P2PI_NULLCLIENT 0x00

/* These refer to the event byte */
#define P2PI_CLIENTINFOS 0x01 /* Client information exchange <struct client_info> */
#define P2PI_CLIENTINFOR 0x02 /* Response event <struct client_info> */
#define P2PI_WHOHASS 0x03 /* Route request <in_addr><void> ... void data is for anything arbitrary (e.g. public key) */
#define P2PI_WHOHASR 0x04 /* Route request <in_addr><void> ... void data is for anything arbitrary (e.g. public key) */
#define P2PI_PACKET 0x05 /* Send packet <in_addr><packet> */

#endif

The comments should be self explanatory.

The tun interface on FreeBSD has a mode (TUNSLMODE) that has if_tun prepends sockaddr to each packet.  I make use of this so that I can easily extract in_addr without examining the packet in anyway.  The struct in_addr is used for routing and route request instead of sockaddr_in as to not reveal the destination port (althought the demonstation does not encrypt the packets for simplicity).

To handle routing and route requests, the demonstration uses a hash table and struct route_info:
Code: [Select]
struct route_info {
int route; /* Can route */
int routereq; /* Route request in progress */
};

The hash table relates in_addr -> route_info.
Furthermore, each connection is associated with a struct con_info which holds the file descriptor, hash table and other miscellaneous necessary information.
Code: [Select]
struct con_info {
int fd, mode;
struct sockaddr_in sin;
struct client_info cname;
uint8_t cid, buff[P2PI_BUFF];
size_t buffsz;
struct hash_table route;
};

Upon recieving a route request, the connection requesting an address is hashed as requesting a route while the demonstration forwards the route request to peers.  Upon a response, the demonstration marks the address as routable on each connection that responded, forwards the response to all connections waiting for a route, and then unmarks the route request.  While this is happening, for sanity reasons, packets read from the tun interface destined for an unroutable address are simply discarded.  Queueing the packets and then sending them on response could have serious consequences since TCP might behave to the delays while a route is in pursuit and queue more packets that might confuse the destination when they are finally sent.
Once an address is marked routable, packets read from tun are dispatched through connections able to route to the destined address.  Peers who recieve the packets should also behave accordingly.

One might ask what would happen if a peer in between a route died.  Since each connection is associated with a hash_table that holds route_info, the hash table for that connection would have been cleared and the the packet would be discarded since it is no longer routable.  The peer will do the above method to try to establish a new route.

In the experiment, I did a simple a test by pinging BOTTLE from BLENDER.  The route was established through LIGHTBULB almost instantaneously and got ping times as low as 50ms.  I was even able to ssh to BOTTLE from BLENDER over this P2P VLAN, all the while LIGHTBULB is routing under the covers.  To test the above scenario with a dead route, I restarted BOTTLE's demonstration which killed the route to BOTTLE.  Soon after, ping packets routed to LIGHTBULB were discarded until LIGHTBULB re-established connection with BOTTLE and the route re-established between LIGHTBULB and BOTTLE.

Here is a picture of the transactions:


That experiment concludes the feasability of a P2P VLAN and demonstrates how one might structure the software to handle the routing.

The real software will probably use UDP since it is probably bad to encapsulate a reliable protocol TCP/IP into TCP/IP packets.  But the bigger issue is how to deal with liars.  A liar is a peer that behaves badly and wrongfully responds to requests and perhaps uses other malicious tatics to damage the network.

One of the major security tatics, aside of encryption, is to use multiple and random routes to prevent any one peer from accumulating all packets.  That said, we treat multiple peers as one logical tunnel.  Although, this serves multiple purposes aside of security, it allows for more robust communication, as well as distributes bandwidth usage among peers.  Most peers will not want to dedicate a large portion of their bandwidth to routing.

The first and foremost problem to be dealt with is automatic determination of a node's IP.  A node could ask its peers if an IP is in use, but a peer could lie.  To overcome this problem, a node could generate a public key, a timely process, and then take a hash of the key.  If we were to use the 10.x.y.z IP block, we would want a 24 bit hash, perhaps I will write a CRC24 method.  Although, 256 bit keys would have high collision rates on a 24 bit hash, the collision rate of IP addresses would be near one in sixteen million.  This method ensures a) Most likely a unique IP is chosen b) Easy validation of liar route responses (the public key is appended to responses) c) Difficulty to target any one specific IP address.  CRC24 might not be a good enough hash, a real cryptographic hash might have to be created to do the hashing since CRC can supposedly be reversed to a degree.  Even though collision rates between 256 bit keys and CRC hashes would be high, one could somehow possibly reverse the process and pick a 256 bit number from one of the possibilities.  But that only fixes one of many problems.

Other measures taken could be heuristics (using known information) and tolerance.  Tolerance assumes that a majority of peers are not liars.  It assumes that the majority of matching responses are the correct response, and if there is no majority response, the responses are discarded.  To note, this would require each peer to have a minimum of three direct peers.  However for small networks, this could be easily overcome.  As the network grows larger of fully functional peers, it can tolerate more liars.

I will compile a list of experiments to test each security measure or a combination of the security measures.  When I get more time, I will code the actual project with a friend.  It's lots of fun :)

A more interesting aspect of a P2P VLAN, is that it could be used not only for small things but for wide scale.  Perhaps it could be a full fledge virtual Internet ... all that would need be done is a p2p-driven DNS system.  Again, such a P2P VLAN ensures anonymity, security and privacy.

Please comment ... especially on how to deal with lying peers.
Until next time :)

See also
http://freenet.sourceforge.net/

774
General Discussion / Re: Official "post your desktop" thread!
« on: August 10, 2006, 04:09:39 am »
Newby: Gnome is nice, but it doesn't look like you put too much effort into yours.
nslay: Yea...I can't stand those boxes that spawn in that lower corning. Stupid WM.


The boxes that spawn in the lower corner...or "the clip", are the parent processes.
These boxes are differentiated by iconified windows in that they represent the entire application.  That said, if you double click a clipped box, it will bring to front, all non-iconified windows as well as the iconified boxes of the parent process.
Moreover, this allows for easy process killing...I can kill a process by right clicking the clipped box and selecting "Kill"
Oh, this also for hiding all windows of a parent process.  If you right-click the minimize button on a window, it will cause all the windows of the parent process to minimize into the clipped box (Hence you will see a dot signifying that windows are hidden there).  This is particularly useful if you want to eliminate some windows and iconified windows (boxes).
So that clip, or the boxes in the lower corner are very useful.  But people generally don't see the value in these different features because its very common for window managers to have a Windows style layout, like KDE, Gnome and so forth.  Window Maker is for lazy bums since its almost completely effortless to do anything, especially if you setup hover-to-focus.

775
Unix / Linux Discussion / Re: Formatting external drive in FreeBSD
« on: August 10, 2006, 03:43:44 am »
I wanted to create a new partition. I'll look into those commands tomorrow.

How would I go about formatting the partition afterwards?

newfs takes care of those details.
newfs /dev/da0s1
will create a UFS2 FS for you...I think -o 1 will make it UFS1
be sure to bsdlabel it beforehand, otherwise Net and OpenBSD will not be able to read the FS.
Although, you may use it without labeling it in FreeBSD

776
Unix / Linux Discussion / Re: Formatting external drive in FreeBSD
« on: August 10, 2006, 02:53:53 am »
Yes. I know how to format an external hard-drive. I just need the fucking commands. I can look up the manual pages once I have them, but so far I have been failed.

Do you want to zero out the disk or create a new partition?
You showed a snipit of fdisk...
If you want to do fdisk for FreeBSD on the entire disk
do:
fdisk -I /dev/da0

otherwise
for a new disk
do:
fdisk -i /dev/da0

or to modify an existing partition
fdisk -# -u /dev/da0

where # is the partition number

To zero out the drive, you could use dd
dd if=/dev/zero of=/dev/da0

Since BSD eliminated block devices, you do not need to specify the block size.

BTW:
If you want to make a UFS2 file system after you fdisk it
do: newfs /dev/da0s1
Although I strongly suggest you bsdlabel /dev/da0s first, otherwise the other BSDs can't read it.  A label is distinguished by a letter, e.g. da0s1a, once you label it do newfs on the label (e.g. newfs /dev/da0s1a).  To be brief, the other BSDs assume the partition is labelled which, if you just did 'newfs /dev/da0s1' will cause problems.

777
General Discussion / Re: Linux versus BSD
« on: August 09, 2006, 07:38:13 pm »
Please note that, while all harddrives behave this way.  The BSD developers still blame the harddrive industry instead of fixing the problem.  Thats another problem with the BSD community ... their attitude.  I've seen messages and emails on mailing lists where users are arguing with developers on whether a problem is a "bug."  I've seen developers call complaining users trolls for making comparisons to Linux about very real problems.  BSD also has a bad attitude towards corporation, probably because of the legal battle with AT&T in the 80s and USL/Novell in the 90s.  This is partly why they are not popular with business.

Wow.....  Sounds familiar.... almost like...  Linux vs. Windows.

To emphasize the point...
from Is Linux for Losers?

Quote from: Theo de Raadt
There's also a difference in motivation. "Linux people do what they do because they hate Microsoft. We do what we do because we love Unix," De Raadt says. The irony, however, is that while noisy Linux fanatics make a great deal out of their hatred for Microsoft, De Raadt says their beloved program is starting to look a lot like what Microsoft puts out. "They have the same rapid development cycle, which leads to crap," he says.


778
General Discussion / Re: Official "post your desktop" thread!
« on: August 09, 2006, 07:01:59 pm »
Hi everyone
I've been saving screenshots of my past desktops and now I have somewhere to put them
These are FreeBSD 6.0 and 6.1 desktops using Window Maker
The dockapps include:


My screenshots:




779
General Discussion / Re: Linux versus BSD
« on: August 04, 2006, 08:48:54 pm »
Okay 40MB cache is an exaggeration, but thats besides the point.  UFS (which is really FFS) relies on ordered meta data writes for consistency.  This was very much the right way to do things ... uhh ... 20 years ago.  Modern harddrives have write caches, the write cache usually reorders writes for efficiency.  Well, for FFS, this is dangerous, especially under heavy I/O.  Upon a reboot from a crash, the system will invoke fsck to check the FS.  The fsck utility makes assumptions that are no longer necessarily true.  Remember, FFS and softupdates rely on ordered meta data writes for consistency, but with write caching on, the writes could have happened in any order.  Another problem with FFS is that since it has no journal, the OS can't simply just "unwind" transactions to fix the FS, it has to run fsck ... this can take quite a long while on large harddrives.
As further proof for the matter, the FreeBSD handbook briefly mentions this:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-disk.html
Quote
11.12.1.5 hw.ata.wc

FreeBSD 4.3 flirted with turning off IDE write caching. This reduced write bandwidth to IDE disks but was considered necessary due to serious data consistency issues introduced by hard drive vendors. The problem is that IDE drives lie about when a write completes. With IDE write caching turned on, IDE hard drives not only write data to disk out of order, but will sometimes delay writing some blocks indefinitely when under heavy disk loads. A crash or power failure may cause serious file system corruption. FreeBSD's default was changed to be safe. Unfortunately, the result was such a huge performance loss that we changed write caching back to on by default after the release. You should check the default on your system by observing the hw.ata.wc sysctl variable. If IDE write caching is turned off, you can turn it back on by setting the kernel variable back to 1. This must be done from the boot loader at boot time. Attempting to do it after the kernel boots will have no effect.

For more information, please see ata(4).

Please note that, while all harddrives behave this way.  The BSD developers still blame the harddrive industry instead of fixing the problem.  Thats another problem with the BSD community ... their attitude.  I've seen messages and emails on mailing lists where users are arguing with developers on whether a problem is a "bug."  I've seen developers call complaining users trolls for making comparisons to Linux about very real problems.  BSD also has a bad attitude towards corporation, probably because of the legal battle with AT&T in the 80s and USL/Novell in the 90s.  This is partly why they are not popular with business.
NetBSD has a Google Summer of Code project to add journaling to FFS.  Although, like ext2, I think the file system ought to be designed from ground up for journaling.  I also think that the FreeBSD foundation should purchase ReiserFS with BSDL and integrate it into the system ... or perhaps implement OpenSolaris's ZFS.

http://netbsd-soc.sourceforge.net/projects/jffs/

Please note, these are the sour points of BSD.  There are plenty of good things about BSD systems so don't dismiss BSD based on the above.

Pages: 1 ... 50 51 [52]