We have different machines with keepalived instances on and I'm looking for a way to check (on networksegment-level) all the virtual_router_id's. (To avoid duplicates.)
So 1 tool that listens on the network for virtual_router_id's and prints them.
Kind Rgds,
Luc
On network level you may want to listen on multicast broadcast to catch the Keepalived servers talking to each other. Example (found on https://www.cyberciti.biz/faq/linux-unix-verify-keepalived-working-or-not/):
root#linux:~# tcpdump -vvv -n -i eth0 host 224.0.0.18
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:19:43.530933 IP (tos 0xc0, ttl 255, id 58763, offset 0, flags [none], proto VRRP (112), length 40)
10.10.10.135 > 224.0.0.18: vrrp 10.10.10.135 > 224.0.0.18: VRRPv2, Advertisement, vrid 134, prio 111, authtype none, intvl 1s, length 20, addrs: 10.10.10.134
11:19:43.530941 IP (tos 0xc0, ttl 255, id 58763, offset 0, flags [none], proto VRRP (112), length 40)
10.10.10.135 > 224.0.0.18: vrrp 10.10.10.135 > 224.0.0.18: VRRPv2, Advertisement, vrid 134, prio 111, authtype none, intvl 1s, length 20, addrs: 10.10.10.134
11:19:43.530968 IP (tos 0xc0, ttl 255, id 58763, offset 0, flags [none], proto VRRP (112), length 40)
10.10.10.135 > 224.0.0.18: vrrp 10.10.10.135 > 224.0.0.18: VRRPv2, Advertisement, vrid 134, prio 111, authtype none, intvl 1s, length 20, addrs: 10.10.10.134
11:19:43.530972 IP (tos 0xc0, ttl 255, id 58763, offset 0, flags [none], proto VRRP (112), length 40)
10.10.10.135 > 224.0.0.18: vrrp 10.10.10.135 > 224.0.0.18: VRRPv2, Advertisement, vrid 134, prio 111, authtype none, intvl 1s, length 20, addrs: 10.10.10.134
This way you can find the virtual router id (vrid) and the corresponding KeepaliveD servers (10.10.10.134 and 10.10.10.135 in this example).
But this is not a bullet-proof way to detect all Keepalived installations/virtual routers. Keepalived can also communicate on unicast (direct ip<->ip) without broadcasting into the network. But if you only use multicast broadcasting of the vrid then you should be able to find and identify the Keepalived servers and the used virtual router id's from a network point of view.
If you use a local monitoring agent/daemon or central configuration system, you can also parse the /etc/keepalived/keepalived.conf file for the virtual_router_id option.
Related
I am trying to solve the below question:
filter the UDP packets having a size equal to 242 bytes.
I looked to this answer udp.length==209 set a filter of packet length in wireshark, but instead of getting packets with length 209 bytes I get packets with length 243 bytes.
screenshot. can anyone explain?
Your image shows a packet like
Frame 243 bytes
'-> Ethernet
'-> IPv4
'-> UDP
'-> Dropbox LAN Sync
Ethernet will be 14 bytes with 6 per src/dst MAC address and 2 bytes for Ethertype.
The IPv4 header will be a minimum of 20 bytes, but could be more with options. It just so happens to be 20 here.
Eth 14 bytes + IP 20 bytes = 34 bytes
243 bytes - 34 bytes of Eth/IP = 209 bytes of UDP data
We have bought a CAN Connect module for our Revpi Connect, and set it up as can been seen in this thread on the Kunbus forum. As far as we understand this will provide the proper termination.
We have also followed this guide provided by Revolution PI.
When checking that the drivers for the CAN module is properly loaded, everything looks fine:
$ dmesg | grep can
[ 4.616900] hi3110 spi0.0 can0: 3110 successfully initialized.
[ 107.049422] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[ 107.049463] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
Checking ip statistics gives this result:
$ ip -det -statistics link show can0
5: can0: mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 50000 sample-point 0.875
tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
hi3110: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 16000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
However, when we turn on candump and send a message using cansend, candump does not show any traffic.
If we check dmesg for CAN again, we get this result:
$ dmesg | grep can
[ 4.616900] hi3110 spi0.0 can0: 3110 successfully initialized.
[ 107.049422] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[ 107.049463] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 292.285353] can: controller area network core (rev 20170425 abi 9)
[ 292.297811] can: raw protocol (rev 20170425)
And if we check ip -statistics again, we can see that the state of the connection has gone into ERROR-PASSIVE:
$ ip -det -statistics link show can0
5: can0: mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
bitrate 50000 sample-point 0.875
tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
hi3110: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 16000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
We are trying to communicate with a computer with and Ixxat USB2CAN v2, at 50kbps, with both highspeed and FT settings, but nothing seems to work. Resetting the connection, seems to put it back into ERROR-ACTIVE state.
When trying to communicate with mentioned computer, using another computer with Socketcan and another Ixxat USB2CAN v2 device, everything works fine.
I should perhaps also mention that if we turn loopback on, we can see the messages we are sending.
We are struggling to understand whether this a hardware or software error. Is our termination in order? Are there any magical settings in SocketCAN we have overlooked? Where should we start debugging this issue?
Any help would be greatly appreciated.
As it turns out, the schematic printed directly on the device is wrong.The schematic on their website is correct.
Hopefully this can help someone else avoid pulling their hair out in the future.
"If a computer handles data in 8-bit sizes and uses a 16-bit address to store and retrieve data in memory, its address space contains 2^16 (65536) bytes or 64k bytes"
My text book has this statement that I'm confused by. Where are they getting 2^16 from? If a computer uses a 16-bit address why isn't that just a 2 byte address space? The textbook hasn't explained how memory is stored in microcomputers and has this statement in the intro chapter. Am I missing something?
If an address is 16 bits, it means that you have 16 bits when referring to a location in memory. The address space is the range of valid addresses, not the physical size of an address.
These addresses start at address 0 (binary 0000 0000 0000 0000) and go up to address 216−1 (binary 1111 1111 1111 1111). That's total of 216 addresses that can be referenced. And if each address refers to 8 bits (i.e. a byte), the total amount of memory that you can refer to with those addresses is 216 × 8 bits, or 216 bytes.
As a smaller example, consider a system with 3-bit addresses, each referring to 4 bits (a nibble).
Address | 0 1 2 3 4 5 6 7
Memory | 0000 0000 0000 0000 0000 0000 0000 0000
Binary |
address | 000 001 010 011 100 101 110 111
The 3-bit addresses can have 23 values, from 0 to 7, and each refers to 4 bits of memory, so this system has a total of 23 = 8 nibbles of memory.
In this system, the only valid address are 0, 1, 2, 3, 4, 5, 6, and 7, so the address space is the set {0, 1, 2, 3, 4, 5, 6, 7}.
As an important point, don't forget that the address space is not necessarily the actual amount of memory available—computers use some handy tricks to use addresses spaces much larger than the memory they actual have available (for example, a 64-bit system can theoretically address 264 bytes of memory, but you don't even have a fraction of that in your computer).
Analogies for address spaces
Here are two analogies that might help you understand the difference between an address space, an address, and a pointer:
The web address space is the set of all URLs, basically the set of strings of the form https://[domain]/[path]. So https://example.com/page is an address, and this link is a pointer to that address.
The United States street address space is (approximately) the set of strings of this form:
[First name] [Last name]
[number] [Street name]
[Town], [STATE] [zip code]
In the same analogy, this is an address:
John Doe
10 Main St.
Faketown, NY 20164
Finally, a pointer is then analagous to the writing on the front of an envelope that the postal service uses to deliver letters.
I have the following input for Myrrix:
11, 101, 1
11, 102, 1
11, 103, 1
11, 104, 1000
11, 105, 1000
11, 106, 1000
12, 101, 1
12, 102, 1
12, 103, 1
12, 222, 1
13, 104, 1000
13, 105, 1000
13, 106, 1000
13, 333, 1000
I am looking for items to recommend to user 11. The expectation is that item 333 will be recommended first (because of the higher weights for user 13 and items 104, 105, 106).
Here are the recommendation results from Myrrix:
11, 222, 0.04709
11, 333, 0.0334058
Notice that item 222 is recommended with strength 0.047, but item 333 is only given a strength of 0.033 --- the opposite of the expected results.
I also would have expected the difference in strength to be larger (since 1000 and 1 are so different), but obviously that's moot when the order isn't even what I expected.
How can I interpret these results and how should I think about the weight parameter? We are working with a large client under a tight deadline and would appreciate any pointers.
It's hard to judge based on a small and synthetic data set. I think the biggest factor will be parameters here -- what are the # of features? lambda? I would expect features = 2 here. If it's higher I think you quickly over-fit this and the results are mostly the noise left over from that after it perfectly explains that user 11 doesn't interact with 222 and 333.
The values are quite low, suggesting both of these are not likely results, and so their order may be more noise than anything. Do you see different results if the model is rebuilt from another random starting point?
My memory is DDR2 800MHz
dmidecode -t memory
Handle 0x1100, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: DIMM_1
Bank Locator: Not Specified
Type: DDR2
Type Detail: Synchronous
Speed: 800 MHz (1.2 ns)
Manufacturer: 7F98000000000000
Serial Number: 2DCCDD00
Asset Tag: 050916
Part Number:
I want to estimate the write or read speed by this info.
Is 800MHz means read/write 800bits per second?
Should we multiple 64 bit datawidth? eg: 800*64 bits/sec. So we can read/write 800*64/8 bytes/sec?
Thanks advance!