Sponsored Content
Full Discussion: WakeOnLan, tcp packet
Operating Systems Solaris WakeOnLan, tcp packet Post 302918979 by Corona688 on Friday 26th of September 2014 01:15:50 PM
Old 09-26-2014
To repeat:

1) You can't make TCP connections to a machine that's asleep.

2) You can't even aim at a machine that's asleep -- by definition, it doesn't have an IP yet.

Things like telnet, ftp, etc mostly use TCP connections, which depend on the machine being awake to respond. UDP is more like ping, where it just gets sent no matter what.

But it takes a very specific kind of UDP packet to reach a sleeping machine: A broadcast UDP packet. It has to be a broadcast because, without an IP, you have no way to "aim" the packet at anyone. I don't think writing to the broadcast address is enough these days, it has to be sent with the special BROADCAST flag. So that rules out /dev/udp tricks as well. Lots of shells don't even have /dev/udp -- despite the name, there is no /dev/udp, that's a shell extension in a few specific versions of KSH and BASH.

Furthermore, a magic packet is going to be difficult to craft in a shell. Shells aren't equipped to deal with binary data. You'd have to worry about which version of what shell everyone has to have any hope -- it wouldn't be portable.

Too bad there's not a well-known scripting language which supports networking, binary strings, and is installed everywhere you go -- like perl...

Last edited by Corona688; 09-26-2014 at 02:24 PM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

Seeing IP packet

Hi, Is there any way that i can directly take out the IP packet and see its contents. Waiting for your answer .............. Bye (4 Replies)
Discussion started by: manjunath
4 Replies

2. IP Networking

TCP packet with RST flag not carrying DSCP

Hello, I'm having an issue with TCP sockets. When the TCP connection is terminated on one end, TCP packet with RST flag set is being sent to the sender. All the packets sent so far were carrying the DSCP 'AF21' set by me. But packet with RST flag is carrying DSCP '0'. Is this expected or... (0 Replies)
Discussion started by: Solace
0 Replies

3. Programming

Changing source port number of a TCP client packet

Hi all, I need to change the source port number of an outgoing TCP packet. First I have to bind the socket to a particular port(suppose 9001) but when I send the TCP packet I want to change the source port number lets say to 9002 still letting the socket to be bound to the same old port (9001).... (0 Replies)
Discussion started by: anuragrai134
0 Replies

4. Programming

packet capture

can anyone tell me how can i capture the packets. i have tried ethernet software to capture them but its not doing what i want it to do it (1 Reply)
Discussion started by: dazdseg
1 Replies

5. IP Networking

Packet decoding

Hi, wondering if anyone can suggest a tool to me that will let me either cut & paste hex or type it in for packet decoding. I want to be able to decode a packet as done with tcpdump or wireshark, but I want to be able to manually input the hex myself. (2 Replies)
Discussion started by: Breakology
2 Replies

6. IP Networking

TCP Packet size

Hi! I'm writing an application (using BSD sockets on a Linux host) which communicates over TCP/IP with an embedded device. This embedded device has an old and real slow integrated circuit (Epson S1S6000) which handles all of the TCP/IP communication for it. Problem is, this circuit (S1S6000)... (7 Replies)
Discussion started by: olle
7 Replies

7. Cybersecurity

filter packet

Exercise: Protection of WEB and DNS servers using the context-free rules for packet filtering: - Protect your WEB-server, so that would be for him can be accessed by browsers, and could go to dns. - Protect your primary DNS-server so that it could be to contact clients and secondary servers.... (1 Reply)
Discussion started by: numeracy
1 Replies

8. Homework & Coursework Questions

filter packet

Exercise: Protection of WEB and DNS servers using the context-free rules for packet filtering: - Protect your WEB-server, so that would be for him can be accessed by browsers, and could go to dns. - Protect your primary DNS-server so that it could be to contact clients and secondary servers.... (1 Reply)
Discussion started by: numeracy
1 Replies

9. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies

10. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies
udp(n)								 Tcl UDP extension							    udp(n)

__________________________________________________________________________________________________________________________________________________

NAME
udp - Create UDP sockets in Tcl SYNOPSIS
package require Tcl 8.2 package require udp 1.0 udp_open ?port? udp_conf sock host port udp_conf sock ?-myport? ?-remote? ?-peer? ?-broadcast bool? ?-ttl count? udp_conf ?-mcastadd groupaddr? udp_conf ?-mcastdrop groupaddr? udp_peek sock ?buffersize? _________________________________________________________________ DESCRIPTION
This package provides support for using UDP through Tcl. The package provides a new channel type and attempts to permit the use of packet oriented UDP over stream oriented Tcl channels. The package defined three commands but udp_conf should be considered depreciated in favour of the standard Tcl command fconfigure. COMMANDS
udp_open ?port? udp_open will open a UDP socket. If port is specified the UDP socket will be opened on that port. Otherwise the system will choose a port and the user can use the udp_conf command to obtain the port number if required. udp_conf sock host port udp_conf in this configuration is used to specify the remote destination for packets written to this sock. You must call this com- mand before writing data to the UDP socket. udp_conf sock ?-myport? ?-remote? ?-peer? ?-broadcast bool? ?-ttl count? In addition to being used to configure the remote host, the udp_conf command is used to obtain information about the UDP socket. -myport Returns the local port number of the socket. -remote Returns the remote hostname and port number as set using udp_conf sock host port. -peer Returns the remote hostname and port number for the packet most recently received by this socket. -broadcast ?boolean? UDP packets can listen and send on the broadcast address. For some systems a flag must be set on the socket to use broadcast. With no argument this option will return the broadcast setting. With a boolean argument the setting can be modified. -ttl ?count? The time-to-live is given as the number of router hops the packet may do. For multicast packets this is important in specify- ing the distribution of the packet. The system default for multicast is 1 which restricts the packet to the local subnet. To permit packets to pass routers, you must increase the ttl. A value of 31 should keep it within a site, while 255 is global. udp_conf ?-mcastadd groupaddr? udp_conf ?-mcastdrop groupaddr? tcludp sockets can support IPv4 multicast operations. To recieve multicast packets the application has to notify the operating sys- tem that it should join a particular multicast group. These are specified as addresses in the range 224.0.0.0 to 239.255.255.255. udp_peek sock ?buffersize? Examine a packet without removing it from the buffer. This function is not available on windows. EXAMPLES
# Send data to a remote UDP socket proc udp_puts {host port} { set s [udp_open] fconfigure $s -remote [list $host $port] puts $s "Hello, World" close $f } # A simple UDP server package require udp proc udpEventHandler {sock} { set pkt [read $sock] set peer [fconfigure $sock -peer] puts "$peer: [string length $pkt] {$pkt}" return } proc udp_listen {port} { set srv [udp_open $port] fconfigure $srv -buffering none -translation binary fileevent $srv readable [list ::udpEventHandler $srv] puts "Listening on udp port: [fconfigure $srv -myport]" return $srv } set sock [udp_listen 53530] vwait forever close $sock # A multicast demo. proc udpEvent {chan} { set data [read $chan] set peer [fconfigure $chan -peer] puts "$peer [string length $data] '$data'" if {[string match "QUIT*" $data]} { close $chan set ::forever 1 } return } set group 224.5.1.21 set port 7771 set s [udp_open $port] fconfigure $s -buffering none -blocking 0 fconfigure $s -mcastadd $group -remote [list $group $port] fileevent $s readable [list udpEvent $s] puts -nonewline $s "hello, world" set ::forever 0 vwait ::forever exit HISTORY
Some of the code in this extension is copied from Michael Miller's tcludp package. (http://www.neosoft.com/tcl/ftparchive/sorted/comm/tcludp-1.0/) Compared with Michael's UDP extension, this extension provides Windows sup- port and provides the ability of using 'gets/puts' to read/write the socket. In addition, it provides more configuration ability. Enhancements to support binary data and to setup the package for the Tcl Extension Architecture by Pat Thoyts. SEE ALSO
socket(n) KEYWORDS
networking, socket, udp COPYRIGHT
Copyright (c) 1999-2000 Columbia University; all rights reserved udp 1.0.7 udp(n)
All times are GMT -4. The time now is 02:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy