Jump to content




Why refer to Rednet as a "wrapper" of Channels? It's much more useful than that!


22 replies to this topic

#1 Chainmanner

  • Members
  • 11 posts

Posted 29 May 2013 - 11:18 AM

Title says all. Channels are no more than a mere minor help to some things that need multiple computer IDs. I think this should be reworded on the wiki.

#2 GopherAtl

  • Members
  • 888 posts

Posted 29 May 2013 - 11:31 AM

in current versions, the rednet api wraps up the lower-level functionality of the modems, which is channel-based. This is what is meant, and it is correct. channels do not augment the rednet api, the rednet api provides a convenient (simplified) wrapper for the direct interface of modems.

#3 Chainmanner

  • Members
  • 11 posts

Posted 29 May 2013 - 11:46 AM

It kinda sounded biased, that's what I meant.

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 May 2013 - 12:34 PM

It's an accurate factual description. How would bias enter into it?

#5 Shazz

  • Members
  • 175 posts

Posted 29 May 2013 - 08:45 PM

Are you using the latest version of ComputerCraft? The rednet API no longer works internally. It uses the modems to send/receive messages.

#6 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 29 May 2013 - 09:00 PM

Having written the initial text ("the rednet API is now just a wrapper for modems and channels"), I can assure you that bias had nothing to do with it. Take a look at /lua/rom/apis/rednet (within ComputerCraft.zip) and you'll see what I mean. It is nothing more than a helpful API that simplifies the process of using modems a bit.

In case you don't feel like looking it up, here's a link to the entire API.

#7 BigSHinyToys

  • Members
  • 1,001 posts

Posted 29 May 2013 - 09:15 PM

View PostBubba, on 29 May 2013 - 09:00 PM, said:

Having written the initial text ("the rednet API is now just a wrapper for modems and channels"), I can assure you that bias had nothing to do with it. Take a look at /lua/rom/apis/rednet (within ComputerCraft.zip) and you'll see what I mean. It is nothing more than a helpful API that simplifies the process of using modems a bit.

In case you don't feel like looking it up, here's a link to the entire API.
rednet is a network protocol. It defines packet structurer and interfaces with hardware.

#8 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 29 May 2013 - 09:43 PM

View PostBigSHinyToys, on 29 May 2013 - 09:15 PM, said:

It defines packet structurer
Are we looking at the same code? Because I see no packets let alone a `structure` for them.

#9 D3matt

  • Members
  • 830 posts

Posted 29 May 2013 - 10:36 PM

View Posttheoriginalbit, on 29 May 2013 - 09:43 PM, said:

View PostBigSHinyToys, on 29 May 2013 - 09:15 PM, said:

It defines packet structurer
Are we looking at the same code? Because I see no packets let alone a `structure` for them.
Rednet is a layer 2 protocol, like MAC. It has very basic frames, containing the following: Sender Channel, Reply Channel, and Message.

#10 JJRcop

  • Members
  • 131 posts

Posted 29 May 2013 - 11:06 PM

I think rednet is inadvisable if you know what you're doing, but it does help simplify things to people who don't.

#11 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 May 2013 - 11:08 PM

View PostJJRcop, on 29 May 2013 - 11:06 PM, said:

I think rednet is inadvisable if you know what you're doing, but it does help simplify things to people who don't.

This is simply not true. It's good to use rednet if your use case doesn't require more. It's easier to create tools and have things work interoperably if people use similar standards (i.e., rednet). I would encourage direct use of modem methods only if the use case cannot otherwise function with the rednet API.

#12 JJRcop

  • Members
  • 131 posts

Posted 29 May 2013 - 11:15 PM

View PostLyqyd, on 29 May 2013 - 11:08 PM, said:

View PostJJRcop, on 29 May 2013 - 11:06 PM, said:

I think rednet is inadvisable if you know what you're doing, but it does help simplify things to people who don't.

This is simply not true. It's good to use rednet if your use case doesn't require more. It's easier to create tools and have things work interoperably if people use similar standards (i.e., rednet). I would encourage direct use of modem methods only if the use case cannot otherwise function with the rednet API.

But rednet is so easy to spoof! You can just change the reply channel and act like you're another computer. Also, I used the word 'think', so that means it is my personal opinion, not a fact or unanimously agreed standard.

#13 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 May 2013 - 11:20 PM

Implying that anyone who chooses to use rednet doesn't know what they're doing isn't exactly a neutral opinion. It's also only very loosely related to the actual topic (at best!), so it seems like you simply have an axe to grind.

#14 JJRcop

  • Members
  • 131 posts

Posted 29 May 2013 - 11:25 PM

You're right. While I don't believe that everyone who chooses to use rednet is dumb, I definitely did leave enough loose ends open for someone to easily take it that way. I'm sorry.

#15 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 30 May 2013 - 11:23 AM

View PostShazz, on 29 May 2013 - 08:45 PM, said:

Are you using the latest version of ComputerCraft? The rednet API no longer works internally. It uses the modems to send/receive messages.
Rednet does definitely still work. Rednet via bundled cables, however, does not.

I usually still used the rednet api for computers that I want to ensure will communicate in a standardized manner. There is no real way to 'spoof' as another computer, as you cannot fake a computer ID. As long as your program is written properly, there is not much that wrapping the modem directly can do that the rednet api can't do already, with the exception of channels, of course.

#16 BigSHinyToys

  • Members
  • 1,001 posts

Posted 30 May 2013 - 11:43 AM

View PostCranium, on 30 May 2013 - 11:23 AM, said:

Rednet does definitely still work. Rednet via bundled cables, however, does not.

I usually still used the rednet api for computers that I want to ensure will communicate in a standardized manner. There is no real way to 'spoof' as another computer, as you cannot fake a computer ID. As long as your program is written properly, there is not much that wrapping the modem directly can do that the rednet api can't do already, with the exception of channels, of course.

It is quite easy to write an api the same as rendet but gets its ID from a variable that the user can alter allowing that computer to be what ever ID the user wants it to be. this can facilitate a man in the middle style attack. The rednet api is a non secure means of communication and can be fooled.

[Edit]
If you would like I can provide proof via PM

#17 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 30 May 2013 - 11:59 AM

I should have clarified then. Using the default rednet api, there would be no way to spoof. But yes, you can wrap the peripheral directly, and send using a specified ID.

#18 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 30 May 2013 - 12:03 PM

View PostCranium, on 30 May 2013 - 11:23 AM, said:

There is no real way to 'spoof' as another computer
the return channel parameter can be modified, allowing you to spoof it
EDIT:

View PostCranium, on 30 May 2013 - 11:59 AM, said:

I should have clarified then. Using the default rednet api, there would be no way to spoof. But yes, you can wrap the peripheral directly, and send using a specified ID.
you can modify os.getComputerID

#19 BigSHinyToys

  • Members
  • 1,001 posts

Posted 30 May 2013 - 12:09 PM

View PostCranium, on 30 May 2013 - 11:59 AM, said:

I should have clarified then. Using the default rednet api, there would be no way to spoof. But yes, you can wrap the peripheral directly, and send using a specified ID.
The main vulnerability is you don't know if the "client / user" is using rednet or a custom "hacked" version. This means the ID's should be ignored in terms of verifying user and another system used in authentication.

#20 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 30 May 2013 - 04:08 PM

Sure you can't really fake a computer ID (other than overwriting os.computerID or the like as stated), but if there aren't any more than 128 computers placed down (this is usually the case), you could pretty much open channels 0 - 127 (or 1 - 128) to intercept any modem messages from computers within range.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users