I have written a small expect script to telnet a FreeBSD machine and send some commands to that machine remotely, through Windows XP machine These commands are being sent periodically in a loop. After sending few command , the scripts throws the following exception: write(spawn_id=]: broken pipe while executing "send -s "ipfw pipe 1 config delay $mod_delay \r"" invoked from within "expect -nobrace 1# { for { set cycle 0 } { $cycle < $no_of_cycles } {incr cycle } { puts "###..." invoked from within "expect { "1#" { for { set cycle 0 } { $cycle < $no_of_cycles } {incr cycle } { Can anybody please let me know the cause for this. Is this issue of the freeBSD machine or my PC. Can what can be the workaround for this Extract from my script: .. .. expect { "1#" { for { set cycle 0 } { $cycle < $no_of_cycles } {incr cycle } { puts "##### CYCLE NUMBER -- $cycle #####" while { $delay <= $max_delay } { set mod_delay [join "$delay ms" ""] puts stdout "\nDelay set to $mod_delay\n" send -s "ipfw pipe 1 config delay $mod_delay \r" set delay [expr $delay + $incr_delay] after $wait } set delay $min_delay } } timeout { puts "Timeout !!!" exp_continue } } .. .. .. Additional Info: I am using Dummynet application of FreeBSD to simulate Network delays. And these commands are used to insert variable delays in packets received from one port and are then sent out on another interface.
On Apr 14, 12:11 pm, "Ranjan" <ranjan.kap...@gmail.com> wrote: > I have written a small expect script to telnet a FreeBSD machine and > send some commands to that machine remotely, through Windows XP > machine > These commands are being sent periodically in a loop. After sending > few command , the scripts throws the following exception: > write(spawn_id=]: broken pipe This tells you one thing: the telnet process has died. From there, you should investigate: (1) Which side broke the connection first (use WireShark on your windows machine, or a tcpdump/tethereal on the unix one). (2) If the first F packet comes from the remote host, what happened there (the in.telnetd and children). I don't know FreeBSD but if there were something like strace(Linux) or truss(Solaris), I'd try it. -Alex
I started ethereal on windows XP machine. Before the problem occurred, there were some packets like "This frame is a (suspected) retransmission", and there after it is sending ARP packets for the FreeBSD PC IP. I am now able to ping the machine manually, but telnet to the machine is very slow. (I waiting for 30 seconds after entering password). Both the machines are connected on same switch , and I am able to successfully telnet other machines (ie there is no networking issue otherwise).
On Apr 16, 7:40 am, "Ranjan" <ranjan.kap...@gmail.com> wrote: > I started ethereal on windows XP machine. Before the problem occurred, > there were some packets like "This frame is a (suspected) > retransmission", and there after it is sending ARP packets for the > FreeBSD PC IP. I am now able to ping the machine manually, but telnet > to the machine is very slow. (I waiting for 30 seconds after entering > password). Both the machines are connected on same switch , and I am > able to successfully telnet other machines (ie there is no networking > issue otherwise). Maybe a half/full-duplex mismatch or autoneg failure between the switch and one of the hosts ? Look at the collision counts on both sides... -Alex
On Apr 16, 5:03 pm, "Alexandre Ferrieux" <alexandre.ferri...@gmail.com> wrote: > On Apr 16, 7:40 am, "Ranjan" <ranjan.kap...@gmail.com> wrote: > > > I started ethereal on windows XP machine. Before the problem occurred, > > there were some packets like "This frame is a (suspected) > > retransmission", and there after it is sending ARP packets for the > > FreeBSD PC IP. I am now able to ping the machine manually, but telnet > > to the machine is very slow. (I waiting for 30 seconds after entering > > password). Both the machines are connected on same switch , and I am > > able to successfully telnet other machines (ie there is no networking > > issue otherwise). > > Maybe a half/full-duplex mismatch or autoneg failure between the > switch and one of the hosts ? Look at the collision counts on both > sides... > > -Alex Alex, I too couldnt interpret much from the packet captures. I think I need to isolate the two machines and check if network congestion has something to do. Or else I will try installing tcl on freebsd (dont know if it will work..) and do directly on that machine....
Ranjan wrote: > Both the machines are connected on same switch , and I am > able to successfully telnet other machines (ie there is no networking > issue otherwise). Sometimes individual ports on switches go bad or get flakey. Try moving wires about and see if the problem moves to another machine. -- Darren New / San Diego, CA, USA (PST) His kernel fu is strong. He studied at the Shao Linux Temple.
On Apr 14, 5:11 am, "Ranjan" <ranjan.kap...@gmail.com> wrote: > I have written a small expect script to telnet a FreeBSD machine and > send some commands to that machine remotely, through Windows XP > machine > These commands are being sent periodically in a loop. After sending > few command , the scripts throws the following exception: > > write(spawn_id=]: broken pipe > while executing > "send -s "ipfw pipe 1 config delay $mod_delay \r"" > invoked from within > "expect -nobrace 1# { > > for { set cycle 0 } { $cycle < $no_of_cycles } {incr > cycle } { > puts "###..." > invoked from within > "expect { > "1#" { > > for { set cycle 0 } { $cycle < $no_of_cycles } {incr > cycle } { > > Can anybody please let me know the cause for this. > Is this issue of the freeBSD machine or my PC. Can what can be the > workaround for this > > Extract from my script: > . > . > expect { > "1#" { > > for { set cycle 0 } { $cycle < $no_of_cycles } {incr > cycle } { > puts "##### CYCLE NUMBER -- $cycle #####" > while { $delay <= $max_delay } { > set mod_delay [join "$delay ms" ""] > puts stdout "\nDelay set to $mod_delay\n" > > send -s "ipfw pipe 1 config delay $mod_delay > \r" > set delay [expr $delay + $incr_delay] > after $wait > } > > set delay $min_delay > } > } > timeout { puts "Timeout !!!" > exp_continue } > > } > . > . > . > Additional Info: I am using Dummynet application of FreeBSD to > simulate Network delays. > And these commands are used to insert variable > delays in packets received from one port and are then sent out > on another interface. You also use "puts stdout" to report you loop to the user on the XP machine you should use send_user "##### ....". Carl
I moved the two machines to an isolated switch but still the problem is occuring. It has been noticed that (after the problem occurs) the ping reply comes in <1ms but the telnet to the machine is very slow, you need to wait for many seconds before the next line appears. I changed the XP machine but the telnet was still slow, and after restarting the freeBSD machine everything becomes OK. So seems probably something goes wrong on FreeBSD machine. Now I want to avoid telnet the FreeBSD machine. Is there is any package of Tcl compatible with FreeBSD? Thanks, Ranjan
On Apr 19, 7:45 pm, Ranjan <ranjan.kap...@gmail.com> wrote: > machine but the telnet was still slow, and after restarting the > freeBSD machine everything becomes OK. So seems probably something > goes wrong on FreeBSD machine. Rebooting and being fine is a bit frustrating... Again, have you looked at the collision count (ifconfig) and ethernet autoneg status (mii-diag et al) ? -Alex
On 19 Apr, 18:45, Ranjan <ranjan.kap...@gmail.com> wrote: > I moved the two machines to an isolated switch but still the problem > is occuring. > It has been noticed that (after the problem occurs) the ping reply > comes in <1ms but the telnet to the machine is very slow, you need to > wait for many seconds before the next line appears. I changed the XP > machine but the telnet was still slow, and after restarting the > freeBSD machine everything becomes OK. So seems probably something > goes wrong on FreeBSD machine. > > Now I want to avoid telnet the FreeBSD machine. Is there is any > package of Tcl compatible with FreeBSD? > > Thanks, > Ranjan Hows about set sfd [ socket <host> <port> ] spawn -open $sfd Derek
On Apr 20, 1:27 am, Alexandre Ferrieux <alexandre.ferri...@gmail.com> wrote: > On Apr 19, 7:45 pm, Ranjan <ranjan.kap...@gmail.com> wrote: > > > machine but the telnet was still slow, and after restarting the > > freeBSD machine everything becomes OK. So seems probably something > > goes wrong on FreeBSD machine. > > Rebooting and being fine is a bit frustrating... > Again, have you looked at the collision count (ifconfig) and ethernet > autoneg status (mii-diag et al) ? > > -Alex Alex, Does ifconfig command show collision count? Also mii-diag, ifplugstatus command is not working on FreeBSD machine. Regards, Ranjan
On Apr 20, 2:04 pm, derek.phi...@csr.com wrote: > > > Now I want to avoid telnet the FreeBSD machine. Is there is any > > package of Tcl compatible with FreeBSD? > > Hows about > set sfd [ socket <host> <port> ] > spawn -open $sfd He has *network* problems. Replacing telnet by a handmade socket changes nothing (telnet is also on top of TCP). -Alex
In article <1176731829.533894.124450@n76g2000hsh.googlegroups.com>, Ranjan <ranjan.kapoor@gmail.com> wrote: . . . >Or else I will try installing tcl on freebsd (dont know if it will >work..) and do directly on that machine.... > I'm uncertain of what you're saying here. I can assure you, though, that Tcl has a looooooooong history of working quite nicely under FreeBSD--did you have a question about that?
In article <3g79g4-6qh.ln1@lairds.us>, Cameron Laird <claird@lairds.us> wrote: >In article <1176731829.533894.124450@n76g2000hsh.googlegroups.com>, >Ranjan <ranjan.kapoor@gmail.com> wrote: > . > . > . >>Or else I will try installing tcl on freebsd (dont know if it will >>work..) and do directly on that machine.... >> > >I'm uncertain of what you're saying here. I can assure you, >though, that Tcl has a looooooooong history of working quite >nicely under FreeBSD--did you have a question about that? There *was* a question. I like to think <URL: http://wiki.tcl.tk/2422 > answers it.